Issue 91 fixed

[sky9x] More than 256 lines allowed in menus (SD files list)
This commit is contained in:
bsongis
2012-09-03 22:25:20 +00:00
parent acfb88ac7b
commit 9da2ce3ac4
5 changed files with 31 additions and 32 deletions
-15
View File
@@ -63,21 +63,6 @@ const char * audioFilenames[] = {
"timer10",
"timer20",
"timer30"
#if 0
AU_FRSKY_WARN1 = AU_FRSKY_FIRST,
AU_FRSKY_WARN2,
AU_FRSKY_CHEEP,
AU_FRSKY_RING,
AU_FRSKY_SCIFI,
AU_FRSKY_ROBOT,
AU_FRSKY_CHIRP,
AU_FRSKY_TADA,
AU_FRSKY_CRICKET,
AU_FRSKY_SIREN,
AU_FRSKY_ALARMC,
AU_FRSKY_RATATA,
AU_FRSKY_TICK,
#endif
};
uint32_t sdAvailableAudioFiles = 0;
+5 -11
View File
@@ -177,7 +177,7 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max)
return checkIncDec(event,i_val,i_min,i_max,EE_GENERAL);
}
bool check_simple(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, uint8_t maxrow)
bool check_simple(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, maxrow_t maxrow)
{
return check(event, curr, menuTab, menuTabSize, 0, 0, maxrow);
}
@@ -224,16 +224,15 @@ void check_rotary_encoder()
#define SCROLL_POT1_TH 32
#if defined(ROTARY_ENCODERS)
#define MAXCOL(row) ((horTab && row >= 0) ? pgm_read_byte(horTab+min(row, (int8_t)horTabMax)) : (const uint8_t)0)
#define MAXCOL(row) ((horTab && row >= 0) ? pgm_read_byte(horTab+min(row, (maxrow_t)horTabMax)) : (const uint8_t)0)
#else
#define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, horTabMax)) : (const uint8_t)0)
#define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, (maxrow_t)horTabMax)) : (const uint8_t)0)
#endif
#define INC(val,max) if(val<max) {val++;} else {val=0;}
#define DEC(val,max) if(val>0 ) {val--;} else {val=max;}
bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, uint8_t maxrow)
bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, maxrow_t maxrow)
{
int8_t maxcol = MAXCOL(m_posVert);
@@ -481,12 +480,7 @@ bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTa
MenuFuncP g_menuStack[5];
uint8_t g_menuPos[4];
uint8_t g_menuStackPtr = 0;
#if defined(ROTARY_ENCODERS)
int8_t m_posVert;
#else
uint8_t m_posVert;
#endif
maxrow_t m_posVert;
uint8_t m_posHorz;
void popMenu()
+10 -5
View File
@@ -152,15 +152,20 @@ void check_rotary_encoder();
#endif
// Menus related stuff ...
#if defined(ROTARY_ENCODERS)
extern int8_t m_posVert;
#if defined(SDCARD)
#define maxrow_t int16_t
#elif defined(ROTARY_ENCODERS)
#define maxrow_t int8_t
#else
extern uint8_t m_posVert;
#define maxrow_t uint8_t
#endif
extern maxrow_t m_posVert;
extern uint8_t m_posHorz;
inline void minit(){m_posVert=m_posHorz=0;}
bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *subTab, uint8_t subTabMax, uint8_t maxrow);
bool check_simple(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, uint8_t maxrow);
bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *subTab, uint8_t subTabMax, maxrow_t maxrow);
bool check_simple(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, maxrow_t maxrow);
bool check_submenu_simple(uint8_t event, uint8_t maxrow);
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
+4 -1
View File
@@ -1006,7 +1006,10 @@ enum AUDIO_SOUNDS {
AU_TIMER_20,
AU_TIMER_30,
AU_FRSKY_FIRST,
AU_FRSKY_WARN1 = AU_FRSKY_FIRST,
AU_FRSKY_BEEP1 = AU_FRSKY_FIRST,
AU_FRSKY_BEEP2,
AU_FRSKY_BEEP3,
AU_FRSKY_WARN1,
AU_FRSKY_WARN2,
AU_FRSKY_CHEEP,
AU_FRSKY_RING,
+12
View File
@@ -251,6 +251,18 @@ void audioQueue::event(uint8_t e, uint8_t f)
case AU_TIMER_LT3:
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_NOW);
break;
case AU_FRSKY_BEEP1:
play(BEEP_DEFAULT_FREQ,10,1,0);
pause(200);
break;
case AU_FRSKY_BEEP2:
play(BEEP_DEFAULT_FREQ,20,1,0);
pause(200);
break;
case AU_FRSKY_BEEP3:
play(BEEP_DEFAULT_FREQ,30,1,0);
pause(200);
break;
case AU_FRSKY_WARN1:
play(BEEP_DEFAULT_FREQ+20,15,5,2);
pause(200);