From a271ce4d34da4efb2a25114da7a5725d344c85ce Mon Sep 17 00:00:00 2001 From: ffedoroff Date: Thu, 19 Jan 2017 17:46:45 +0600 Subject: [PATCH] Invert signal on rfswitch pin (#1738) Since that code was migrated from Arduino, I should invert pin --- app/modules/rfswitch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/modules/rfswitch.c b/app/modules/rfswitch.c index 81d978b5..cdcb64fd 100644 --- a/app/modules/rfswitch.c +++ b/app/modules/rfswitch.c @@ -63,9 +63,9 @@ static const Protocol proto[] = { * Transmit a single high-low pulse. */ void transmit(HighLow pulses, bool invertedSignal, int pulseLength, int pin) { - platform_gpio_write(pin, invertedSignal); - os_delay_us(pulseLength * pulses.high); platform_gpio_write(pin, !invertedSignal); + os_delay_us(pulseLength * pulses.high); + platform_gpio_write(pin, invertedSignal); os_delay_us(pulseLength * pulses.low); } @@ -85,7 +85,6 @@ void send(unsigned long protocol_id, unsigned long pulse_length, unsigned long r transmit(p.zero, p.invertedSignal, pulse_length, pin); } transmit(p.syncFactor, p.invertedSignal, pulse_length, pin); - platform_gpio_write(pin, false); } }