improve data reciver
This commit is contained in:
13
main.cpp
13
main.cpp
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user