APP 4

Dependencies:   mbed CRC16 mbed-rtos

Committer:
vinbel93
Date:
Tue Feb 23 15:58:49 2016 +0000
Revision:
25:a3e06778c54b
Parent:
23:d41a23d8f2d7
profiling-ish

Who changed what in which revision?

UserRevisionLine numberNew contents of line
manl2003 2:1250280a511b 1 #include "mbed.h"
manl2003 2:1250280a511b 2 #include "LPC17xx.h"
manl2003 4:272f227e4442 3 #include <bitset>
manl2003 4:272f227e4442 4
vinbel93 5:9f05591944ba 5 #pragma once
manl2003 2:1250280a511b 6
manl2003 2:1250280a511b 7 #define CLOCKS_TO_SECOND 96000000
vinbel93 20:f0932bfe09ed 8 #define FRAMESIZE 696
vinbel93 9:b937f9c6d682 9 #define MAX_DATA 640
vinbel93 25:a3e06778c54b 10 #define DEBUG 1
vinbel93 25:a3e06778c54b 11 #define PROFILE 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
vinbel93 25:a3e06778c54b 27 #if DEBUG
vinbel93 25:a3e06778c54b 28 void debugPrint();
vinbel93 25:a3e06778c54b 29 #endif
vinbel93 25:a3e06778c54b 30
vinbel93 25:a3e06778c54b 31 void send();
vinbel93 25:a3e06778c54b 32 void read();
vinbel93 25:a3e06778c54b 33 void mainLoop();
manl2003 23:d41a23d8f2d7 34 void initTimers();
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);