From 8fa79377c329068325f9ea64bf1f6de45f300954 Mon Sep 17 00:00:00 2001 From: Werner Backes Date: Tue, 30 Apr 2013 11:08:14 +0200 Subject: [PATCH 1/2] Lowered rfm22b_rcvr supervisor timeout. Timeout values above 159 exceed uint8_t range during timeout calculation and effectively disable the supervisor. --- flight/targets/boards/revolution/pios_board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/targets/boards/revolution/pios_board.h b/flight/targets/boards/revolution/pios_board.h index f58ace784..d7fed3b47 100644 --- a/flight/targets/boards/revolution/pios_board.h +++ b/flight/targets/boards/revolution/pios_board.h @@ -228,7 +228,7 @@ extern uint32_t pios_packet_handler; #define PIOS_RCVR_MAX_DEVS 3 #define PIOS_RCVR_MAX_CHANNELS 12 #define PIOS_GCSRCVR_TIMEOUT_MS 100 -#define PIOS_RFM22B_RCVR_TIMEOUT_MS 200 +#define PIOS_RFM22B_RCVR_TIMEOUT_MS 150 //------------------------- // Receiver PPM input From b48665e59b2eb5bff36670e60e4fa63e3c404f82 Mon Sep 17 00:00:00 2001 From: Werner Backes Date: Tue, 30 Apr 2013 11:24:43 +0200 Subject: [PATCH 2/2] rfm22b receiver supervisor now properly indicates a timeout condition. This allows upper layers to recognize control signal loss. --- flight/pios/common/pios_rfm22b_rcvr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/pios/common/pios_rfm22b_rcvr.c b/flight/pios/common/pios_rfm22b_rcvr.c index faa21b604..3ea942103 100644 --- a/flight/pios/common/pios_rfm22b_rcvr.c +++ b/flight/pios/common/pios_rfm22b_rcvr.c @@ -110,7 +110,7 @@ static void PIOS_RFM22B_RCVR_Supervisor(uint32_t rcvr_id) { // Have we received fresh values since the last update? if (!rfm22b_dev->ppm_fresh) { for (uint8_t i = 0; i < PIOS_RFM22B_RCVR_MAX_CHANNELS; ++i) { - rfm22b_dev->ppm_channel[i] = 0; + rfm22b_dev->ppm_channel[i] = PIOS_RCVR_TIMEOUT; } } rfm22b_dev->ppm_fresh = false;