remove pointers to strings from Zero Page

This commit is contained in:
Pavel Semerad
2011-06-24 17:02:24 +02:00
parent cd2aa66c6f
commit e64be2e6ca
7 changed files with 10 additions and 9 deletions

2
build
View File

@@ -29,7 +29,7 @@ cp -p ChangeLog $R/ChangeLog.txt
# firmwares for more max channels
for N in 3 8 6; do
make clean
make CHANNELS=$N
make CHANNELS=$N || exit 2
cp -p gt3b.s19 $R/gt3b-ch$N-$V.s19
git add $R/gt3b-ch$N-$V.s19
done

3
lcd.c
View File

@@ -700,7 +700,7 @@ void lcd_set_full_on(void) {
_Bool lcd_bck_on; // set when backlight ON
u16 lcd_bck_count; // counter in seconds
u16 lcd_bck_seconds = 30; // default number of backlight seconds
u16 lcd_bck_seconds; // default number of backlight seconds
// set default ON seconds
@@ -719,6 +719,7 @@ void backlight_on_sec(u16 seconds) {
// set on for default seconds
void backlight_on(void) {
if (!lcd_bck_seconds) return; // nothing when not set
backlight_on_sec(lcd_bck_seconds);
}

2
main.c
View File

@@ -55,7 +55,7 @@ static void clock_init(void) {
// copyright to firmware
static u8 *copret(void) {
static const u8 *copyright = "(C) 2011 Pavel Semerad";
static const u8 copyright[] = "(C) 2011 Pavel Semerad";
return copyright;
}

6
menu.c
View File

@@ -185,8 +185,8 @@ static void main_screen(u8 item) {
lcd_chars(cm.name);
}
else if (item == MS_BATTERY) {
static u16 bat_val = 0;
static u16 bat_time = 0;
static u16 bat_val;
static u16 bat_time;
// battery voltage
lcd_segment(LS_SYM_DOT, LS_ON);
@@ -592,7 +592,7 @@ static void menu_expo(void) {
// set abs: OFF, SLO(6), NOR(4), FAS(3)
// pulses between full brake and 1/2 brake and only when enought brake applied
static const u8 *abs_labels[] = {
static const u8 abs_labels[][4] = {
"OFF", "SLO", "NOR", "FAS"
};
#define ABS_LABEL_SIZE (sizeof(abs_labels) / sizeof(u8 *))

View File

@@ -41,7 +41,7 @@
#define TRIM_FUNCTIONS_SIZE 128
@near static u8 trim_functions[TRIM_FUNCTIONS_SIZE];
@near static u8 trim_functions_max;
static const u8 *trim_buttons[] = {
static const u8 trim_buttons[][4] = {
"NOL", "RPT", "MOM", "RES", "END", "SPC"
};
#define TRIM_BUTTONS_SIZE (sizeof(trim_buttons) / sizeof(u8 *))

View File

@@ -188,7 +188,7 @@ void menu_calibrate(void) {
// key test menu
static u8 *key_ids[] = {
static const u8 key_ids[][4] = {
"T1L", "T1R",
"T2F", "T2B",
"T3-", "T3+",

View File

@@ -27,7 +27,7 @@
static u16 inactivity;
static @near u16 inactivity;