APP 4
Dependencies: mbed CRC16 mbed-rtos
APP.h@24:e307f6aad106, 2016-02-23 (annotated)
- Committer:
- manl2003
- Date:
- Tue Feb 23 15:57:09 2016 +0000
- Revision:
- 24:e307f6aad106
- Parent:
- 23:d41a23d8f2d7
Chat pas fonctionnel
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
manl2003 | 2:1250280a511b | 1 | #include "mbed.h" |
manl2003 | 2:1250280a511b | 2 | #include "LPC17xx.h" |
manl2003 | 24:e307f6aad106 | 3 | #include "rtos.h" |
manl2003 | 4:272f227e4442 | 4 | #include <bitset> |
manl2003 | 4:272f227e4442 | 5 | |
vinbel93 | 5:9f05591944ba | 6 | #pragma once |
manl2003 | 2:1250280a511b | 7 | |
manl2003 | 2:1250280a511b | 8 | #define CLOCKS_TO_SECOND 96000000 |
vinbel93 | 20:f0932bfe09ed | 9 | #define FRAMESIZE 696 |
vinbel93 | 9:b937f9c6d682 | 10 | #define MAX_DATA 640 |
manl2003 | 23:d41a23d8f2d7 | 11 | #define DEBUG 0 |
vinbel93 | 6:3181f546e812 | 12 | |
vinbel93 | 6:3181f546e812 | 13 | using namespace std; |
manl2003 | 12:715af3660c73 | 14 | |
manl2003 | 16:cf433716f8d6 | 15 | enum STATES |
manl2003 | 16:cf433716f8d6 | 16 | { |
manl2003 | 23:d41a23d8f2d7 | 17 | PREAMBLE, |
manl2003 | 23:d41a23d8f2d7 | 18 | START, |
manl2003 | 23:d41a23d8f2d7 | 19 | TYPE, |
manl2003 | 23:d41a23d8f2d7 | 20 | LENGTH, |
manl2003 | 23:d41a23d8f2d7 | 21 | DATA, |
manl2003 | 23:d41a23d8f2d7 | 22 | CRC16STATE, |
manl2003 | 23:d41a23d8f2d7 | 23 | END, |
manl2003 | 23:d41a23d8f2d7 | 24 | NOSTATE |
manl2003 | 16:cf433716f8d6 | 25 | }; |
manl2003 | 16:cf433716f8d6 | 26 | |
manl2003 | 24:e307f6aad106 | 27 | struct Message |
manl2003 | 24:e307f6aad106 | 28 | { |
manl2003 | 24:e307f6aad106 | 29 | char buffer[80]; |
manl2003 | 24:e307f6aad106 | 30 | int size; |
manl2003 | 24:e307f6aad106 | 31 | }; |
manl2003 | 24:e307f6aad106 | 32 | |
manl2003 | 23:d41a23d8f2d7 | 33 | void initTimers(); |
manl2003 | 24:e307f6aad106 | 34 | void terminal(void const *args); |
vinbel93 | 20:f0932bfe09ed | 35 | extern void _decodeCallback(bitset<MAX_DATA> decMessage, int size); |
vinbel93 | 17:8d8c33bdcaf5 | 36 | extern void _decodeError(); |
manl2003 | 16:cf433716f8d6 | 37 | extern void _updateState(STATES state); |
vinbel93 | 20:f0932bfe09ed | 38 | extern void _mefDebug(int blu); |