Use existing getStringAtIndex as considers length
This commit is contained in:
committed by
Raphael Coeffic
parent
21f776d40c
commit
19b1db7275
@@ -607,7 +607,8 @@ class ModuleWindow : public FormGroup {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (moduleIdx == INTERNAL_MODULE && isModuleCrossfire(moduleIdx)) {
|
if (moduleIdx == INTERNAL_MODULE && isModuleCrossfire(moduleIdx)) {
|
||||||
new StaticText(this, grid.getFieldSlot(2, 1), getStringAtIndex(STR_CRSF_BAUDRATE, CROSSFIRE_STORE_TO_INDEX(g_eeGeneral.internalModuleBaudrate)), 0,COLOR_THEME_PRIMARY1);
|
char buf[6];
|
||||||
|
new StaticText(this, grid.getFieldSlot(2, 1), getStringAtIndex(buf, STR_CRSF_BAUDRATE, CROSSFIRE_STORE_TO_INDEX(g_eeGeneral.internalModuleBaudrate)), 0,COLOR_THEME_PRIMARY1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module parameters
|
// Module parameters
|
||||||
|
|||||||
@@ -158,13 +158,6 @@ char *getStringAtIndex(char *dest, const char *s, int idx)
|
|||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *getStringAtIndex(const char *s, int idx)
|
|
||||||
{
|
|
||||||
uint8_t len = s[0];
|
|
||||||
return s + 1 + len * idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *strAppendStringWithIndex(char *dest, const char *s, int idx)
|
char *strAppendStringWithIndex(char *dest, const char *s, int idx)
|
||||||
{
|
{
|
||||||
return strAppendUnsigned(strAppend(dest, s), abs(idx));
|
return strAppendUnsigned(strAppend(dest, s), abs(idx));
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ char *strAppendFilename(char *dest, const char *filename, const int size);
|
|||||||
|
|
||||||
#if !defined(BOOT)
|
#if !defined(BOOT)
|
||||||
char *getStringAtIndex(char *dest, const char *s, int idx);
|
char *getStringAtIndex(char *dest, const char *s, int idx);
|
||||||
const char *getStringAtIndex(const char *s, int idx);
|
|
||||||
char *strAppendStringWithIndex(char *dest, const char *s, int idx);
|
char *strAppendStringWithIndex(char *dest, const char *s, int idx);
|
||||||
#define LEN_TIMER_STRING 10 // "-00:00:00"
|
#define LEN_TIMER_STRING 10 // "-00:00:00"
|
||||||
char *getTimerString(char *dest, int32_t tme, TimerOptions timerOptions = {.options = 0});
|
char *getTimerString(char *dest, int32_t tme, TimerOptions timerOptions = {.options = 0});
|
||||||
|
|||||||
Reference in New Issue
Block a user