Auto full-combo Koibumi2000 in Taiko no Tatsujin CS5

Dependencies:   fll mbed-rtos mbed

Committer:
amutake
Date:
Fri Feb 13 13:19:29 2015 +0000
Revision:
0:c80e972b4c59
Child:
1:1abcd83947bf
initial

Who changed what in which revision?

UserRevisionLine numberNew contents of line
amutake 0:c80e972b4c59 1 #include "mbed.h"
amutake 0:c80e972b4c59 2 #include "rtos.h"
amutake 0:c80e972b4c59 3 #include "fll.h"
amutake 0:c80e972b4c59 4
amutake 0:c80e972b4c59 5 #define FRAME 1.0 / 60 // 1 frame (sec)
amutake 0:c80e972b4c59 6 #define PULL_PERIOD 100 // millisec
amutake 0:c80e972b4c59 7
amutake 0:c80e972b4c59 8 void sinkrun(const void *p)
amutake 0:c80e972b4c59 9 {
amutake 0:c80e972b4c59 10 ((Sink*)p)->run();
amutake 0:c80e972b4c59 11 }
amutake 0:c80e972b4c59 12 void outputrun(const void *p)
amutake 0:c80e972b4c59 13 {
amutake 0:c80e972b4c59 14 ((Output*)p)->run();
amutake 0:c80e972b4c59 15 }
amutake 0:c80e972b4c59 16
amutake 0:c80e972b4c59 17 int main(void)
amutake 0:c80e972b4c59 18 {
amutake 0:c80e972b4c59 19 std::vector<button> vec(B_CIRCLE);
amutake 0:c80e972b4c59 20 // user must make Source
amutake 0:c80e972b4c59 21 Source* source = new Source(&vec, true);
amutake 0:c80e972b4c59 22
amutake 0:c80e972b4c59 23 // common pattern
amutake 0:c80e972b4c59 24 Mail<button, QUEUE_SIZE>* btnQueue = new Mail<button, QUEUE_SIZE>();
amutake 0:c80e972b4c59 25 Mutex* mutex = new Mutex();
amutake 0:c80e972b4c59 26
amutake 0:c80e972b4c59 27 Sink* sink = new Sink(source, btnQueue, mutex);
amutake 0:c80e972b4c59 28 rtos::RtosTimer buffer(sinkrun, osTimerPeriodic, (void *)sink);
amutake 0:c80e972b4c59 29
amutake 0:c80e972b4c59 30 Ticker ticker;
amutake 0:c80e972b4c59 31 Output* output = new Output(btnQueue);
amutake 0:c80e972b4c59 32
amutake 0:c80e972b4c59 33 buffer.start(PULL_PERIOD);
amutake 0:c80e972b4c59 34 ticker.attach(output, &Output::run, FRAME);
amutake 0:c80e972b4c59 35
amutake 0:c80e972b4c59 36 while (true) {} // ?
amutake 0:c80e972b4c59 37 }