|
@@ -81,7 +81,9 @@ static int rx_decode(uint32_t width) {
|
|
|
|
|
|
switch (rx_state) {
|
|
|
case UNKNOWN: // Start of frame
|
|
|
- if ( 2240 <= width && width <= 3540 ) {
|
|
|
+ if ( 2240 <= width && width <= 3540 ) { // Hallway-button: 2760
|
|
|
+ //DEBUG_WIDTH_FUNC();
|
|
|
+
|
|
|
rx_state = T0;
|
|
|
}
|
|
|
else {
|
|
@@ -91,7 +93,8 @@ static int rx_decode(uint32_t width) {
|
|
|
|
|
|
case T0: // First half of pulse
|
|
|
|
|
|
- if ( 155 <= width && width <= 305 ) {
|
|
|
+ if ( 155 <= width && width <= 305 ) { // Hallway-button: 230-250
|
|
|
+
|
|
|
rx_state = T1;
|
|
|
|
|
|
}
|
|
@@ -106,10 +109,12 @@ static int rx_decode(uint32_t width) {
|
|
|
break;
|
|
|
|
|
|
case T1:
|
|
|
- if ( 240 <= width && width <= 440 ) {
|
|
|
+ if ( 200 <= width && width <= 440 ) { // Hallway-button: 250-270
|
|
|
+
|
|
|
addBit(0);
|
|
|
- } else if ( (1410-300) <= width && width <= (1410+300) ) {
|
|
|
- DEBUG_WIDTH_FUNC();
|
|
|
+ }
|
|
|
+ else if ( 950 <= width && width <= 1700 ) { // Hallway-button: 1250-1270
|
|
|
+
|
|
|
|
|
|
addBit(1);
|
|
|
} else if( rx_numBits == 64 ) { // end of frame
|
|
@@ -153,7 +158,7 @@ int64_t nextPulseNEXA(uint32_t width)
|
|
|
now = millis();
|
|
|
if( debug_data.max > debug_data_tot.max ) debug_data_tot.max = debug_data.max;
|
|
|
if( debug_data.min < debug_data_tot.min ) debug_data_tot.min = debug_data.min;
|
|
|
- //printf("OREGON DEbug min,max:%u %u\n",debug_data_tot.min,debug_data_tot.max);
|
|
|
+ printf("NEXA Debug min,max:%u %u\n",debug_data_tot.min,debug_data_tot.max);
|
|
|
|
|
|
if( sensor_data != previous_data || (now > (old_time+1000)) ) {
|
|
|
previous_data = sensor_data;
|