improve data reciver

This commit is contained in:
2024-06-10 20:15:41 +02:00
parent 99ab8cf36d
commit 8fbbc167af
3 changed files with 145 additions and 270 deletions

View File

@ -31,7 +31,7 @@ static volatile bool resendNow = false;
static volatile uint8_t resendCounter = 0;
static bool resendEnabled = false;
ISR(PCINT1_vect)
ISR(TIMER1_COMPB_vect)
{
W433DataReciver::staticInterrupt();
}
@ -450,12 +450,13 @@ int main()
RgbLed rgbled( &pwmTc0, &pwmTc2 );
loadRGB(&rgbled);
Pwm16b pwmTc1 ( &TCCR1A, &TCCR1B, &OCR1A, &OCR1B, &ICR1, 0b00000001, true, false);
Pwm16b pwmTc1(&TCCR1A, &TCCR1B, &OCR1A, &OCR1B, &ICR1, 0b00000001, true, false);
setBit(&PCICR, PCIE1, true);
setBit(&PCMSK1, PCINT8, true);
W433DataReciver reciver(&PINC, PC0, &TCNT1, &TIFR1, &sensorPacketRecived, reinterpret_cast<void*>(&serial),
&reciverError);
setBit(&TIMSK1, OCIE1B, true);
setBit(&TCCR1B, CS10, true);
ICR1 = W433DataReciver::calculateOverflowRegister(2000, 1);
OCR1B = ICR1-1;
W433DataReciver reciver(&PINC, PC0, &sensorPacketRecived, reinterpret_cast<void*>(&serial), &reciverError);
W433DataTransmitter transmitter(&PORTB, PB5);
UvosItem::transmitter = &transmitter;