void bluetoothInit(void) { ssd1306ClearScreen(MAIN_AREA); ssd1306Printf(12, 30, &Font_3x6, "%s", "Initializing Bluetooth..."); ssd1306Refresh(); // Allow Remote Escape Sequence bluetoothCmd("AT+AB Config RmtEscapeSequence = true"); // Reset the bluetooth peripheral bluetoothCmd("AT+AB Reset"); // Enable USART Interrupts bluetoothEnable(); }
/* * Refresh Sequence for all sensors of the AeroBal System. * It is performed sequentially by increasing a rolling counter. * This can be put to run on a background process. * * TODO: Bluetooth is disabled during execution. */ void ABSSRefreshSequential(){ buttonsMask(); bluetoothDisable(); switch(ABSSSequentialRefreshCount){ case 0: ABSSRefreshDHT(); break; case 1: ABSSRefreshBMP(); break; case 2: ABSSRefreshWindVane(); break; case 3: ABSSRefreshAnemometer(); break; case 4: ABSSRefreshLoadCells(); break; case 5: ABSSRefreshMPSA(); break; default: ABSSSequentialRefreshCount=-1; break; } ABSSSequentialRefreshCount++; buttonsUnmask(); bluetoothEnable(); }