Firmware for the mbed in the BlueSync Sensor platform. Intended to communicate with a BlueGiga BLE112 Bluetooth LE module over UART.
Dependencies: TimerCapture mbed
Diff: main.cpp
- Revision:
- 6:51884d3fd44d
- Parent:
- 5:fd4773c12f93
--- a/main.cpp Thu Jun 11 20:06:51 2015 +0000 +++ b/main.cpp Fri Jun 12 05:14:50 2015 +0000 @@ -11,7 +11,7 @@ DigitalOut bleSlaveLed(LED1); DigitalOut bleScanningLed(LED2); DigitalOut bleAdvRecv(LED3); -DigitalOut bleTimeStampRecv(LED4); +DigitalOut statusLed(LED4); Ticker ticker; InterruptIn evtWatchPin(p28); @@ -19,7 +19,7 @@ bleSlaveLed = 0; bleScanningLed = 0; bleAdvRecv = 0; - bleTimeStampRecv = 0; + //statusLed = 0; } /*uint8_t[] toByteArray(uint32_t input) { @@ -73,7 +73,7 @@ void on_offset_recv() { blankOutLeds(); - bleTimeStampRecv = 1; + statusLed = 1; intByteArray bitArray; printf("Trying to get offset\r\n"); for (int i = 0; i < 4; i++) { @@ -126,12 +126,14 @@ printf("+++Capture register: %d (%08x) timer: %d (%08x)\r\n", timestamp, timestamp, LPC_TIM2->TC, LPC_TIM2->TC ); + statusLed = !statusLed; } int main() { printf("Booted!\r\n"); printf("SystemCoreClock is %d, %d ticks per ms\r\n", SystemCoreClock, SystemCoreClock/1000); ticker.attach(&on_tick, 5.0); + statusLed = 1; TimerCapture::startTimer(); capPin = new TimerCapture(p30); evtPin = new TimerCapture(p29);