Added reciver debugging
This commit is contained in:
13
main.cpp
13
main.cpp
@ -372,6 +372,17 @@ void serialDispatch(Serial* serial, SVector<WirelessRelay, MAX_RELAYS>* relays,
|
||||
}
|
||||
}
|
||||
|
||||
void reciverError(uint8_t code, void* userData)
|
||||
{
|
||||
if(!sensorsPaused)
|
||||
{
|
||||
Serial* serial = reinterpret_cast<Serial*>(userData);
|
||||
serial->write_p(PSTR("ERROR CODE: "));
|
||||
serial->write(code);
|
||||
serial->putChar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
void sensorPacketRecived(uint32_t data, void* userData)
|
||||
{
|
||||
if(!sensorsPaused)
|
||||
@ -424,7 +435,7 @@ int main()
|
||||
|
||||
setBit(&PCICR, PCIE1, true);
|
||||
setBit(&PCMSK1, PCINT8, true);
|
||||
W433DataReciver reciver(&PINC, PC0, &TCNT1, &TIFR1, &sensorPacketRecived, reinterpret_cast<void*>(&serial));
|
||||
W433DataReciver reciver(&PINC, PC0, &TCNT1, &TIFR1, &sensorPacketRecived, reinterpret_cast<void*>(&serial), &reciverError);
|
||||
|
||||
serial.write_p(PSTR("RGBController v1.0 starting\n"));
|
||||
|
||||
|
Reference in New Issue
Block a user