Cosmetics
This commit is contained in:
+2
-10
@@ -30,16 +30,12 @@
|
|||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t auxSerialTracesEnabled();
|
uint8_t auxSerialTracesEnabled();
|
||||||
|
|
||||||
#if defined(SIMU)
|
#if defined(SIMU)
|
||||||
typedef void (*traceCallbackFunc)(const char * text);
|
EXTERN_C(typedef void (*traceCallbackFunc)(const char * text));
|
||||||
extern traceCallbackFunc traceCallback;
|
extern traceCallbackFunc traceCallback;
|
||||||
void debugPrintf(const char * format, ...);
|
EXTERN_C(void debugPrintf(const char * format, ...));
|
||||||
#elif defined(SEMIHOSTING)
|
#elif defined(SEMIHOSTING)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define debugPrintf(...) printf(__VA_ARGS__)
|
#define debugPrintf(...) printf(__VA_ARGS__)
|
||||||
@@ -51,10 +47,6 @@ uint8_t auxSerialTracesEnabled();
|
|||||||
#define debugPrintf(...)
|
#define debugPrintf(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define TRACE_NOCRLF(...) debugPrintf(__VA_ARGS__)
|
#define TRACE_NOCRLF(...) debugPrintf(__VA_ARGS__)
|
||||||
#define TRACE(f_, ...) debugPrintf((f_ "\r\n"), ##__VA_ARGS__)
|
#define TRACE(f_, ...) debugPrintf((f_ "\r\n"), ##__VA_ARGS__)
|
||||||
#define DUMP(data, size) dump(data, size)
|
#define DUMP(data, size) dump(data, size)
|
||||||
|
|||||||
+12
-2
@@ -70,9 +70,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __GNUC__
|
#if __GNUC__
|
||||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
#define PACK(__Declaration__) __Declaration__ __attribute__((__packed__))
|
||||||
#else
|
#else
|
||||||
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
|
#define PACK(__Declaration__) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SIMU)
|
#if defined(SIMU)
|
||||||
@@ -87,4 +87,14 @@
|
|||||||
#define DIM(__arr) (sizeof((__arr)) / sizeof((__arr)[0]))
|
#define DIM(__arr) (sizeof((__arr)) / sizeof((__arr)[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
#define EXTERN_C(__Declaration__) extern "C" { __Declaration__ ; }
|
||||||
|
#define EXTERN_C_START extern "C" {
|
||||||
|
#define EXTERN_C_END }
|
||||||
|
#else
|
||||||
|
#define EXTERN_C(__Declaration__) __Declaration__
|
||||||
|
#define EXTERN_C_START
|
||||||
|
#define EXTERN_C_END
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _DEFINITIONS_H_
|
#endif // _DEFINITIONS_H_
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class InputEditWindow: public Page {
|
|||||||
|
|
||||||
void updateCurves() {
|
void updateCurves() {
|
||||||
FormGridLayout grid;
|
FormGridLayout grid;
|
||||||
grid.setLabelWidth(120);
|
grid.setLabelWidth(INPUT_EDIT_LABELS_WIDTH);
|
||||||
|
|
||||||
updateCurvesWindow->clear();
|
updateCurvesWindow->clear();
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ class InputEditWindow: public Page {
|
|||||||
NumberEdit * edit;
|
NumberEdit * edit;
|
||||||
|
|
||||||
FormGridLayout grid;
|
FormGridLayout grid;
|
||||||
grid.setLabelWidth(120);
|
grid.setLabelWidth(INPUT_EDIT_LABELS_WIDTH);
|
||||||
grid.spacer(PAGE_PADDING);
|
grid.spacer(PAGE_PADDING);
|
||||||
|
|
||||||
ExpoData * line = expoAddress(index) ;
|
ExpoData * line = expoAddress(index) ;
|
||||||
@@ -196,6 +196,10 @@ class InputEditWindow: public Page {
|
|||||||
});
|
});
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
|
#if LCD_H > LCD_W
|
||||||
|
grid.setMarginRight(10);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
new StaticText(window, grid.getLabelSlot(), STR_EXPONAME);
|
new StaticText(window, grid.getLabelSlot(), STR_EXPONAME);
|
||||||
new TextEdit(window, grid.getFieldSlot(), line->name, sizeof(line->name));
|
new TextEdit(window, grid.getFieldSlot(), line->name, sizeof(line->name));
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ void generalDefault()
|
|||||||
uint16_t evalChkSum()
|
uint16_t evalChkSum()
|
||||||
{
|
{
|
||||||
uint16_t sum = 0;
|
uint16_t sum = 0;
|
||||||
const int16_t *calibValues = (const int16_t *) &g_eeGeneral.calib[0];
|
const int16_t * calibValues = (const int16_t *) &g_eeGeneral.calib[0];
|
||||||
for (int i=0; i<12; i++)
|
for (int i=0; i<12; i++)
|
||||||
sum += calibValues[i];
|
sum += calibValues[i];
|
||||||
return sum;
|
return sum;
|
||||||
@@ -370,12 +370,12 @@ void defaultInputs()
|
|||||||
expo->weight = 100;
|
expo->weight = 100;
|
||||||
expo->mode = 3; // TODO constant
|
expo->mode = 3; // TODO constant
|
||||||
#if defined(TRANSLATIONS_CZ)
|
#if defined(TRANSLATIONS_CZ)
|
||||||
for (int c=0; c<4; c++) {
|
for (int c = 0; c < 4; c++) {
|
||||||
g_model.inputNames[i][c] = char2zchar(STR_INPUTNAMES[1+4*(stick_index-1)+c]);
|
g_model.inputNames[i][c] = STR_INPUTNAMES[1+4*(stick_index-1)+c];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for (int c=0; c<3; c++) {
|
for (int c = 0; c < 3; c++) {
|
||||||
g_model.inputNames[i][c] = char2zchar(STR_VSRCRAW[2 + 4 * stick_index + c]);
|
g_model.inputNames[i][c] = STR_VSRCRAW[2 + 4 * stick_index + c];
|
||||||
}
|
}
|
||||||
#if LEN_INPUT_NAME > 3
|
#if LEN_INPUT_NAME > 3
|
||||||
g_model.inputNames[i][3] = '\0';
|
g_model.inputNames[i][3] = '\0';
|
||||||
|
|||||||
@@ -130,4 +130,6 @@ enum LcdColorIndex
|
|||||||
#define FONT_TABLE_SIZE 1
|
#define FONT_TABLE_SIZE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
constexpr uint32_t INPUT_EDIT_LABELS_WIDTH = 120;
|
||||||
|
|
||||||
#endif // _LIBOPENUI_CONFIG_H_
|
#endif // _LIBOPENUI_CONFIG_H_
|
||||||
|
|||||||
@@ -128,4 +128,6 @@ enum LcdColorIndex
|
|||||||
#define FONT_TABLE_SIZE 1
|
#define FONT_TABLE_SIZE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
constexpr uint32_t INPUT_EDIT_LABELS_WIDTH = 80;
|
||||||
|
|
||||||
#endif // _LIBOPENUI_CONFIG_H_
|
#endif // _LIBOPENUI_CONFIG_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user