Browse Source

change example name, let space for the actual vario function

fertito
Marc 12 years ago
parent
commit
c1db39bdd0
  1. 14
      driver/timer.c
  2. 4
      ezchronos.c
  3. 18
      logic/menu.c
  4. 4
      logic/menu.h
  5. 48
      logic/prout.c
  6. 26
      logic/prout.h
  7. 2
      makefile
  8. 4
      tools/config.py

14
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;

4
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

18
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

4
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;

48
logic/vario.c → 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;
}

26
logic/vario.h → 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

2
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)))

4
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}

Loading…
Cancel
Save