Auto full-combo Koibumi2000 in Taiko no Tatsujin CS5
Dependencies: fll mbed-rtos mbed
main.cpp
- Committer:
- sierra
- Date:
- 2015-02-13
- Revision:
- 1:1abcd83947bf
- Parent:
- 0:c80e972b4c59
- Child:
- 2:165723d41023
File content as of revision 1:1abcd83947bf:
#include "mbed.h" #include "rtos.h" #include "fll.h" #define FRAME 1.0 / 60 // 1 frame (sec) #define PULL_PERIOD 100 // millisec void sinkrun(const void *p) { ((Sink*)p)->run(); } void outputrun(const void *p) { ((Output*)p)->run(); } int main(void) { button array[] = {R1|B_CIRCLE, 0}; // user must make Source Source* source = new Source(array, sizeof(array)/sizeof(button), true); // common pattern Mail<button, QUEUE_SIZE>* btnQueue = new Mail<button, QUEUE_SIZE>(); Mutex* mutex = new Mutex(); Sink* sink = new Sink(source, btnQueue, mutex); rtos::RtosTimer buffer(sinkrun, osTimerPeriodic, (void *)sink); Ticker ticker; Output* output = new Output(btnQueue); buffer.start(PULL_PERIOD); ticker.attach(output, &Output::run, FRAME); Thread::wait(osWaitForever); }