From d6690cbb01a6a935212dcfa74ce9900b663549d7 Mon Sep 17 00:00:00 2001 From: "gruvin@gmail.com" Date: Wed, 22 Aug 2012 05:18:20 +0000 Subject: [PATCH] Finally figured out how to add a warning tone for DSM2 range check mode. (It only took me about an hour and a half! :-/) Also increased max filename length handled by "Restore Model" to 16 chars (only when long filename support is configured in FatFs/ffconf.h) Bertrand: I had to comment out a call to sdPollmS() as it doesn't seem to exist. Hopefully the system freeze when I try to select "Restore Model" is just a symptom of this same issue ... though I fear not. --- src/menus.h | 7 ++++++- src/open9x.cpp | 11 +++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/menus.h b/src/menus.h index cf863523c..2bae1a977 100644 --- a/src/menus.h +++ b/src/menus.h @@ -207,7 +207,12 @@ void displayConfirmation(uint8_t event); #if defined(SDCARD) #define MENU_MAX_LINES 4 -#define MENU_LINE_LENGTH (8+1) +#include "FatFs/ffconf.h" +#ifdef _USE_LFN +# define MENU_LINE_LENGTH (16+1) +#else +# define MENU_LINE_LENGTH (8+1) +#endif extern const char *s_menu[MENU_MAX_LINES]; extern char s_bss_menu[MENU_MAX_LINES*MENU_LINE_LENGTH]; extern uint8_t s_menu_count; diff --git a/src/open9x.cpp b/src/open9x.cpp index ccefa2a16..bbf272541 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -2483,7 +2483,11 @@ inline void doMixerCalculations(uint16_t tmr10ms, uint8_t tick10ms) #endif evalFunctions(); - + +#if defined(DSM2) + if (s_rangecheck_mode) AUDIO_PLAY(AU_FRSKY_CHEEP); +#endif + #if defined(PCBARM) if (currentSpeakerVolume != requiredSpeakerVolume) { setVolume(requiredSpeakerVolume); @@ -2798,7 +2802,7 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer per10ms(); #if defined(PCBV4) && defined(SDCARD) - sdPoll10mS(); +// sdPoll10mS(); #endif #if !defined(PCBV4) @@ -3632,7 +3636,7 @@ extern void audioTask(void* pdata); int main(void) { - // The WDT remains active after a WDT reset -- at maximum clock speed. So it's + // G: The WDT remains active after a WDT reset -- at maximum clock speed. So it's // important to disable it before commencing with system initialisation (or // we could put a bunch more wdt_reset()s in. But I don't like that approach // during boot up.) @@ -3643,7 +3647,6 @@ int main(void) uint8_t mcusr = MCUCSR; MCUCSR = 0; #endif - #if !defined(PCBARM) // TODO test WDT on ARM wdt_disable();