Fork for Get Started Demo
Dependencies: DebouncedInterrupt dash7-alp mbed-rtos mbed wizzi-utils
Fork of D7A_Demo_full by
main.cpp@0:aa25c4c8ddbf, 2015-11-19 (annotated)
- Committer:
- Jeej
- Date:
- Thu Nov 19 17:25:00 2015 +0000
- Revision:
- 0:aa25c4c8ddbf
- Child:
- 1:49da0144dd4c
Basic boot test.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jeej | 0:aa25c4c8ddbf | 1 | #include "mbed.h" |
Jeej | 0:aa25c4c8ddbf | 2 | #include "rtos.h" |
Jeej | 0:aa25c4c8ddbf | 3 | #include "dbg.h" |
Jeej | 0:aa25c4c8ddbf | 4 | |
Jeej | 0:aa25c4c8ddbf | 5 | int main() |
Jeej | 0:aa25c4c8ddbf | 6 | { |
Jeej | 0:aa25c4c8ddbf | 7 | //-------------------------------------------// |
Jeej | 0:aa25c4c8ddbf | 8 | // ----- Debug session over USB Serial ----- // |
Jeej | 0:aa25c4c8ddbf | 9 | //-------------------------------------------// |
Jeej | 0:aa25c4c8ddbf | 10 | // Hyperterminal configuration: // |
Jeej | 0:aa25c4c8ddbf | 11 | // 115200 bauds, 8-bit data, no parity // |
Jeej | 0:aa25c4c8ddbf | 12 | // Linux: 'sudo screen /dev/ttyACMx 115200' // |
Jeej | 0:aa25c4c8ddbf | 13 | // or: 'cat /dev/ttyACMx' // |
Jeej | 0:aa25c4c8ddbf | 14 | // Windows: Use an hyperterminal such as: // |
Jeej | 0:aa25c4c8ddbf | 15 | // - TeraTerm // |
Jeej | 0:aa25c4c8ddbf | 16 | // - Putty // |
Jeej | 0:aa25c4c8ddbf | 17 | //-------------------------------------------// |
Jeej | 0:aa25c4c8ddbf | 18 | DBG_OPEN(); |
Jeej | 0:aa25c4c8ddbf | 19 | |
Jeej | 0:aa25c4c8ddbf | 20 | // Test Debug traces |
Jeej | 0:aa25c4c8ddbf | 21 | DPRINT("BOOT\r\n"); |
Jeej | 0:aa25c4c8ddbf | 22 | |
Jeej | 0:aa25c4c8ddbf | 23 | // Set main task to lowest priority |
Jeej | 0:aa25c4c8ddbf | 24 | osThreadSetPriority(osThreadGetId(), osPriorityIdle); |
Jeej | 0:aa25c4c8ddbf | 25 | while(true) |
Jeej | 0:aa25c4c8ddbf | 26 | { |
Jeej | 0:aa25c4c8ddbf | 27 | // Wait to avoid beeing stuck in loop |
Jeej | 0:aa25c4c8ddbf | 28 | Thread::wait(osWaitForever); |
Jeej | 0:aa25c4c8ddbf | 29 | } |
Jeej | 0:aa25c4c8ddbf | 30 | } |