#include <mbed.h>
/*sub routine registration———-*/
void Blinky();
void ActivateFlagLoop();
DigitalOut myled(LED1);
//Timer Setting
Ticker intvTimer; // インターバルタイマ
int BlinkCount = 0;
bool FlagLoopFunction = false;
/*mein program———————-*/
int main()
{
//Cycle Setting
intvTimer.attach_us(&ActivateFlagLoop, 10000); //100Hz
while (true)
{
if (FlagLoopFunction) {
//8msec
//DebugOUT = true;
FlagLoopFunction = false;
Blinky();
}
else {
}
}
}
void Blinky()
{
BlinkCount += 1;
if (BlinkCount > 50)
{
myled = !myled;
BlinkCount = 0;
}
else
{
}
}
void ActivateFlagLoop() {
if(!FlagLoopFunction) FlagLoopFunction = true;
}