1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

Cosmetic changes (thanks to Bertrand's review)

This commit is contained in:
Damjan Adamic 2014-12-07 09:41:31 +01:00
parent e9f8b14f8b
commit e55b7504c3
3 changed files with 24 additions and 24 deletions

View file

@ -38,11 +38,11 @@
#if defined(PCBTARANIS) && defined(REVPLUS) && defined(LCD_DUAL_BUFFER) #if defined(PCBTARANIS) && defined(REVPLUS) && defined(LCD_DUAL_BUFFER)
display_t displayBuf1[DISPLAY_BUF_SIZE]; display_t displayBuf1[DISPLAY_BUF_SIZE];
display_t displayBuf2[DISPLAY_BUF_SIZE]; display_t displayBuf2[DISPLAY_BUF_SIZE];
display_t * displayBuf = displayBuf1; display_t * displayBuf = displayBuf1;
#else #else
display_t displayBuf[DISPLAY_BUF_SIZE]; display_t displayBuf[DISPLAY_BUF_SIZE];
#endif #endif
void lcd_clear() void lcd_clear()

View file

@ -355,7 +355,7 @@ static int luaLcdClear(lua_State *L)
static int luaLcdDrawPoint(lua_State *L) static int luaLcdDrawPoint(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
lcd_plot(x, y); lcd_plot(x, y);
@ -364,7 +364,7 @@ static int luaLcdDrawPoint(lua_State *L)
static int luaLcdDrawLine(lua_State *L) static int luaLcdDrawLine(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x1 = luaL_checkinteger(L, 1); int x1 = luaL_checkinteger(L, 1);
int y1 = luaL_checkinteger(L, 2); int y1 = luaL_checkinteger(L, 2);
int x2 = luaL_checkinteger(L, 3); int x2 = luaL_checkinteger(L, 3);
@ -383,7 +383,7 @@ static int luaLcdGetLastPos(lua_State *L)
static int luaLcdDrawText(lua_State *L) static int luaLcdDrawText(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
const char * s = luaL_checkstring(L, 3); const char * s = luaL_checkstring(L, 3);
@ -394,7 +394,7 @@ static int luaLcdDrawText(lua_State *L)
static int luaLcdDrawTimer(lua_State *L) static int luaLcdDrawTimer(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int seconds = luaL_checkinteger(L, 3); int seconds = luaL_checkinteger(L, 3);
@ -405,7 +405,7 @@ static int luaLcdDrawTimer(lua_State *L)
static int luaLcdDrawNumber(lua_State *L) static int luaLcdDrawNumber(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int n = luaL_checkinteger(L, 3); int n = luaL_checkinteger(L, 3);
@ -416,7 +416,7 @@ static int luaLcdDrawNumber(lua_State *L)
static int luaLcdDrawChannel(lua_State *L) static int luaLcdDrawChannel(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int channel = -1; int channel = -1;
@ -439,7 +439,7 @@ static int luaLcdDrawChannel(lua_State *L)
static int luaLcdDrawSwitch(lua_State *L) static int luaLcdDrawSwitch(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int s = luaL_checkinteger(L, 3); int s = luaL_checkinteger(L, 3);
@ -450,7 +450,7 @@ static int luaLcdDrawSwitch(lua_State *L)
static int luaLcdDrawSource(lua_State *L) static int luaLcdDrawSource(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int s = luaL_checkinteger(L, 3); int s = luaL_checkinteger(L, 3);
@ -461,7 +461,7 @@ static int luaLcdDrawSource(lua_State *L)
static int luaLcdDrawPixmap(lua_State *L) static int luaLcdDrawPixmap(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
const char * filename = luaL_checkstring(L, 3); const char * filename = luaL_checkstring(L, 3);
@ -475,7 +475,7 @@ static int luaLcdDrawPixmap(lua_State *L)
static int luaLcdDrawRectangle(lua_State *L) static int luaLcdDrawRectangle(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int w = luaL_checkinteger(L, 3); int w = luaL_checkinteger(L, 3);
@ -486,7 +486,7 @@ static int luaLcdDrawRectangle(lua_State *L)
static int luaLcdDrawFilledRectangle(lua_State *L) static int luaLcdDrawFilledRectangle(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int w = luaL_checkinteger(L, 3); int w = luaL_checkinteger(L, 3);
@ -498,7 +498,7 @@ static int luaLcdDrawFilledRectangle(lua_State *L)
static int luaLcdDrawGauge(lua_State *L) static int luaLcdDrawGauge(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int w = luaL_checkinteger(L, 3); int w = luaL_checkinteger(L, 3);
@ -516,7 +516,7 @@ static int luaLcdDrawGauge(lua_State *L)
static int luaLcdDrawScreenTitle(lua_State *L) static int luaLcdDrawScreenTitle(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
const char * str = luaL_checkstring(L, 1); const char * str = luaL_checkstring(L, 1);
int idx = luaL_checkinteger(L, 2); int idx = luaL_checkinteger(L, 2);
int cnt = luaL_checkinteger(L, 3); int cnt = luaL_checkinteger(L, 3);
@ -530,7 +530,7 @@ static int luaLcdDrawScreenTitle(lua_State *L)
static int luaLcdDrawCombobox(lua_State *L) static int luaLcdDrawCombobox(lua_State *L)
{ {
if (! luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1); int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2); int y = luaL_checkinteger(L, 2);
int w = luaL_checkinteger(L, 3); int w = luaL_checkinteger(L, 3);
@ -1990,7 +1990,8 @@ void luaRunNonGuiScripts()
lastRunTime = get_tmr10ms() - t0; lastRunTime = get_tmr10ms() - t0;
} }
bool luaRunGuiScripts(uint8_t evt){ bool luaRunGuiScripts(uint8_t evt)
{
//execute one cycle of Lua scripts that use LCD //execute one cycle of Lua scripts that use LCD
//either stand-alone or other (telemetry scripts) //either stand-alone or other (telemetry scripts)

View file

@ -288,11 +288,10 @@ void menusTask(void * pdata)
perMainArm(); perMainArm();
// TODO remove completely massstorage from sky9x firmware // TODO remove completely massstorage from sky9x firmware
U32 runtime = (U32)(CoGetOSTime() - start); U32 runtime = (U32)(CoGetOSTime() - start);
if (runtime >= MENU_TASK_PERIOD_TICKS) { // deduct the thread run-time from the wait, if run-time was more than
//no delay // desired period, then skip the wait all together
} if (runtime < MENU_TASK_PERIOD_TICKS) {
else { CoTickDelay(MENU_TASK_PERIOD_TICKS - runtime);
CoTickDelay(MENU_TASK_PERIOD_TICKS - runtime); // 5*2ms for now
} }
} }