From c1db39bdd09abdf3327ada203c111bc58e26eafb Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 24 Jul 2010 16:43:59 +0200 Subject: [PATCH] change example name, let space for the actual vario function --- driver/timer.c | 14 +++++------ ezchronos.c | 4 ++-- logic/menu.c | 18 +++++++------- logic/menu.h | 4 ++-- logic/{vario.c => prout.c} | 48 +++++++++++++++++++------------------- logic/{vario.h => prout.h} | 26 ++++++++++----------- makefile | 2 +- tools/config.py | 4 ++-- 8 files changed, 60 insertions(+), 60 deletions(-) rename logic/{vario.c => prout.c} (82%) rename logic/{vario.h => prout.h} (87%) diff --git a/driver/timer.c b/driver/timer.c index 14ec1c4..2b307b1 100644 --- a/driver/timer.c +++ b/driver/timer.c @@ -60,7 +60,7 @@ #include "rfsimpliciti.h" #include "simpliciti.h" #include "acceleration.h" -#include "vario.h" +#include "prout.h" //pfs #ifndef ELIMINATE_BLUEROBIN @@ -331,8 +331,8 @@ __interrupt void TIMER0_A0_ISR(void) } } -#ifdef CONFIG_VARIO - if (is_vario()) vario_tick(); +#ifdef CONFIG_PROUT + if (is_prout()) prout_tick(); #endif // Do a temperature measurement each second while menu item is active if (is_temp_measurement()) request.flag.temperature_measurement = 1; @@ -530,8 +530,8 @@ __interrupt void TIMER0_A1_5_ISR(void) #ifdef CONFIG_EGGTIMER update_eggtimer_timer(); #endif -#ifdef CONFIG_VARIO - update_vario_timer(); +#ifdef CONFIG_PROUT + update_prout_timer(); #endif // Enable timer interrupt TA0CCTL2 |= CCIE; @@ -540,8 +540,8 @@ __interrupt void TIMER0_A1_5_ISR(void) #ifdef CONFIG_EGGTIMER eggtimer_tick(); #endif -#ifdef CONFIG_VARIO - vario_tick(); +#ifdef CONFIG_PROUT + prout_tick(); #endif break; diff --git a/ezchronos.c b/ezchronos.c index 1d32c47..fbef7e0 100644 --- a/ezchronos.c +++ b/ezchronos.c @@ -381,8 +381,8 @@ void init_global_variables(void) reset_eggtimer(); #endif -#ifdef CONFIG_VARIO - reset_vario(); +#ifdef CONFIG_PROUT + reset_prout(); #endif #ifdef CONFIG_PHASE_CLOCK diff --git a/logic/menu.c b/logic/menu.c index f4f23ae..9afe346 100644 --- a/logic/menu.c +++ b/logic/menu.c @@ -71,8 +71,8 @@ #include "eggtimer.h" #endif -#ifdef CONFIG_VARIO -#include "vario.h" +#ifdef CONFIG_PROUT +#include "prout.h" #endif // ************************************************************************************************* @@ -313,15 +313,15 @@ const struct menu menu_L2_RFBSL = FUNCTION(mx_rfbsl), // sub menu function FUNCTION(display_rfbsl), // display function FUNCTION(update_time), // new display data -#ifdef CONFIG_VARIO - &menu_L2_Vario, +#ifdef CONFIG_PROUT + &menu_L2_Prout, }; -// Line2 - VARIO -const struct menu menu_L2_Vario = +// Line2 - PROUT +const struct menu menu_L2_Prout = { - FUNCTION(sx_vario), // direct function - FUNCTION(mx_vario), // sub menu function - FUNCTION(display_vario), // display function + FUNCTION(sx_prout), // direct function + FUNCTION(mx_prout), // sub menu function + FUNCTION(display_prout), // display function FUNCTION(update_time), // new display data &menu_L2_Date, #else diff --git a/logic/menu.h b/logic/menu.h index 3d79b35..af2154d 100644 --- a/logic/menu.h +++ b/logic/menu.h @@ -94,8 +94,8 @@ extern const struct menu menu_L2_Ppt; extern const struct menu menu_L2_Sync; extern const struct menu menu_L2_CalDist; extern const struct menu menu_L2_RFBSL; -#ifdef CONFIG_VARIO -extern const struct menu menu_L2_Vario; +#ifdef CONFIG_PROUT +extern const struct menu menu_L2_Prout; #endif // Pointers to current menu item extern const struct menu * ptrMenu_L1; diff --git a/logic/vario.c b/logic/prout.c similarity index 82% rename from logic/vario.c rename to logic/prout.c index 8fa2889..41f51cc 100644 --- a/logic/vario.c +++ b/logic/prout.c @@ -64,41 +64,41 @@ // logic #include "user.h" -#include "vario.h" +#include "prout.h" #include "menu.h" -struct variotimer svariotimer; +struct prouttimer sprouttimer; #define POUET_STR " POUET PROUT KATAPLOP POUET" static u8 *str = POUET_STR; -void vario_tick() +void prout_tick() { - svariotimer.pos = (svariotimer.pos+1) % (sizeof(POUET_STR)-7); - display_vario(0, 0); + sprouttimer.pos = (sprouttimer.pos+1) % (sizeof(POUET_STR)-7); + display_prout(0, 0); } -u8 is_vario(void) +u8 is_prout(void) { - return (svariotimer.state == VARIO_RUN && (ptrMenu_L2 == &menu_L2_Vario)); + return (sprouttimer.state == PROUT_RUN && (ptrMenu_L2 == &menu_L2_Prout)); } -void update_vario_timer() +void update_prout_timer() { /* TA0CCR2 = TA0CCR2 + STOPWATCH_1HZ_TICK; */ } -void start_vario() +void start_prout() { - svariotimer.state = VARIO_RUN; + sprouttimer.state = PROUT_RUN; /* // Init CCR register with current time */ /* TA0CCR2 = TA0R; */ /* // Load CCR register with next capture time */ - /* update_vario_timer(); */ + /* update_prout_timer(); */ /* // Reset IRQ flag */ /* TA0CCTL2 &= ~CCIFG; */ @@ -109,46 +109,46 @@ void start_vario() display_symbol(LCD_ICON_RECORD, SEG_ON); } -void stop_vario() +void stop_prout() { /* // Clear timer interrupt enable */ /* TA0CCTL2 &= ~CCIE; */ - svariotimer.state = VARIO_STOP; + sprouttimer.state = PROUT_STOP; display_symbol(LCD_ICON_RECORD, SEG_OFF); // Call draw routine immediately - display_vario(LINE2, DISPLAY_LINE_UPDATE_FULL); + display_prout(LINE2, DISPLAY_LINE_UPDATE_FULL); } -void sx_vario(u8 line) +void sx_prout(u8 line) { if (button.flag.down) { - if (svariotimer.state == VARIO_STOP){ - start_vario(); + if (sprouttimer.state == PROUT_STOP){ + start_prout(); } else { - stop_vario(); + stop_prout(); } } } -void mx_vario(u8 line) +void mx_prout(u8 line) { } -void display_vario(u8 line, u8 update) +void display_prout(u8 line, u8 update) { u8 cur[7]; - memcpy(cur, str + svariotimer.pos, 6); + memcpy(cur, str + sprouttimer.pos, 6); cur[6] = 0; display_chars(LCD_SEG_L2_5_0, cur, SEG_ON); } -void reset_vario(void) +void reset_prout(void) { - svariotimer.pos = 0; - svariotimer.state = VARIO_STOP; + sprouttimer.pos = 0; + sprouttimer.state = PROUT_STOP; } diff --git a/logic/vario.h b/logic/prout.h similarity index 87% rename from logic/vario.h rename to logic/prout.h index cd1b502..b1c32b2 100644 --- a/logic/vario.h +++ b/logic/prout.h @@ -51,23 +51,23 @@ // -#ifndef VARIO_H_ -#define VARIO_H_ +#ifndef PROUT_H_ +#define PROUT_H_ // menu functions -extern void sx_vario(u8 line); -extern void mx_vario(u8 line); -extern void display_vario(u8 line, u8 update); +extern void sx_prout(u8 line); +extern void mx_prout(u8 line); +extern void display_prout(u8 line, u8 update); -extern void reset_vario(void); -extern void vario_tick(void); -extern void update_vario_timer(void); -extern u8 is_vario(void); +extern void reset_prout(void); +extern void prout_tick(void); +extern void update_prout_timer(void); +extern u8 is_prout(void); -#define VARIO_STOP (0u) -#define VARIO_RUN (1u) +#define PROUT_STOP (0u) +#define PROUT_RUN (1u) -struct variotimer +struct prouttimer { u8 state; u8 pos; @@ -75,5 +75,5 @@ struct variotimer u8 time[8]; }; -extern struct variotimer svariotimer; +extern struct prouttimer sprouttimer; #endif diff --git a/makefile b/makefile index b3848c3..9e0f406 100644 --- a/makefile +++ b/makefile @@ -19,7 +19,7 @@ CC_INCLUDE = -I$(PROJ_DIR)/ -I$(PROJ_DIR)/include/ -I$(PROJ_DIR)/gcc/ -I$(PROJ_D CC_COPT = $(CC_CMACH) $(CC_DMACH) $(CC_DOPT) $(CC_INCLUDE) -LOGIC_SOURCE = logic/acceleration.c logic/alarm.c logic/altitude.c logic/battery.c logic/clock.c logic/date.c logic/menu.c logic/rfbsl.c logic/rfsimpliciti.c logic/stopwatch.c logic/temperature.c logic/test.c logic/user.c logic/phase_clock.c logic/eggtimer.c logic/vario.c +LOGIC_SOURCE = logic/acceleration.c logic/alarm.c logic/altitude.c logic/battery.c logic/clock.c logic/date.c logic/menu.c logic/rfbsl.c logic/rfsimpliciti.c logic/stopwatch.c logic/temperature.c logic/test.c logic/user.c logic/phase_clock.c logic/eggtimer.c logic/prout.c LOGIC_O = $(addsuffix .o,$(basename $(LOGIC_SOURCE))) diff --git a/tools/config.py b/tools/config.py index 5cbb4d7..39d96e1 100755 --- a/tools/config.py +++ b/tools/config.py @@ -85,8 +85,8 @@ DATA["CONFIG_PHASE_CLOCK"] = { "default": False} -DATA["CONFIG_VARIO"] = { - "name": "Variometer (in fact, simple test)", +DATA["CONFIG_PROUT"] = { + "name": "Simple example that displays a text", "depends": [], "default": False}