void ledTaskCallback (OS::Task &task) { UNUSED(task); while(1){ led1.on(); led2.off(); OS::sleep(500); led1.off(); led2.on(); OS::sleep(500); } }
void mainTaskCallback (OS::Task &task) { UNUSED(task); OS::sleep(100); en2v8.on(); OS::sleep(100); OS::sleep(100); bluetoothShutdown.off(); OS::sleep(100); Bluetooth::instance().init("MobilECG"); //Turn on ECG clock TIM_HandleTypeDef tim; tim.Instance = TIM1; HAL_TIM_PWM_Start(&tim, TIM_CHANNEL_3); if (!ADS1298::instance().start()) Logger::panic("Failed to initialize ADS1298."); while(1){ if (!Bluetooth::instance().isConnected()){ ADS1298::instance().clear(); OS::sleep(10); continue; } if (ADS1298::instance().getAvailableData()<512){ OS::sleep(10); continue; } ecgSender.send(); } }
int main(){ bluetoothShutdown.on(); en2v8.off(); OS::run(); }