Jordan Earls
/
pjon_testing
Testing getting PJON working on mbed https://github.com/gioblu/PJON
Diff: pjon.h
- Revision:
- 2:5648483c5dbc
- Parent:
- 1:bd0ee507dd4c
--- a/pjon.h Sun Jan 10 09:41:00 2016 +0000 +++ b/pjon.h Sat Jan 16 15:51:23 2016 +0000 @@ -64,11 +64,16 @@ #define COMPATIBILITY_MODE true //mbed (needs tweaking) - #define BIT_WIDTH 45 - #define BIT_SPACER 115 - #define ACCEPTANCE 39 - #define READ_DELAY 25 - +/* + #define BIT_WIDTH 52 + #define BIT_SPACER 121 + #define ACCEPTANCE 51 + #define READ_DELAY 29 + */ + #define BIT_WIDTH 45 + #define BIT_SPACER 113 + #define ACCEPTANCE 45 + #define READ_DELAY 23 /* The following constants setup are quite conservative and determined only with a huge amount of time and blind testing (without oscilloscope) tweaking values and analysing results. Theese can be changed to obtain @@ -148,15 +153,18 @@ uint8_t device_id; char *content; uint8_t length; - unsigned long registration; + uint32_t registration; int state; - unsigned long timing; + uint32_t timing; }; typedef void (* receiver)(uint8_t length, uint8_t *payload); typedef void (* pjon_error)(uint8_t code, uint8_t data); -static void dummy_error_handler(uint8_t code, uint8_t data) {}; +static void dummy_error_handler(uint8_t code, uint8_t data) { + DigitalOut myled(LED1); + myled = 1; + }; class PJON {