1 ///////////////////////////////////////////////////////////////////////////////
\r
3 // IAR Atmel AVR C/C++ Compiler V4.30F/W32 13/Mar/2008 04:49:38 /
\r
4 // Copyright 1996-2007 IAR Systems. All rights reserved. /
\r
6 // Source file = C:\home\kevin\pub\src\bc100\IAR\menu.c /
\r
7 // Command line = C:\home\kevin\pub\src\bc100\IAR\menu.c /
\r
8 // --cpu=tiny861 -ms -o C:\home\kevin\pub\src\bc1 /
\r
9 // 00\IAR\Release\Obj\ -D NDEBUG -lCN /
\r
10 // C:\home\kevin\pub\src\bc100\IAR\Release\List\ /
\r
11 // -lB C:\home\kevin\pub\src\bc100\IAR\Release\Li /
\r
12 // st\ --initializers_in_flash -s9 /
\r
13 // --no_cross_call --no_tbaa /
\r
14 // -DENABLE_BIT_DEFINITIONS -e -I "C:\Program /
\r
15 // Files\IAR Systems\Embedded Workbench /
\r
16 // 4.0\avr\INC\" -I "C:\Program Files\IAR /
\r
17 // Systems\Embedded Workbench 4.0\avr\INC\CLIB\" /
\r
18 // --eeprom_size 512 --misrac=5-9,11-12,14,16-17, /
\r
19 // 19-21,24-26,29-32,34-35,38-39,42-43,46,50, /
\r
20 // 52-54,56-59,61-62,64-65,68-80,83-84,87-91, /
\r
21 // 94-95,98-100,103-110,112-126 /
\r
22 // Enabled MISRA C rules = 5-9,11-12,14,16-17,19-21,24-26,29-32,34-35, /
\r
23 // 38-39,42-43,46,50,52-54,56-59,61-62,64-65, /
\r
24 // 68-80,83-84,87-91,94-95,98-100,103-110,112-126 /
\r
25 // Checked = 5,7-9,11-12,14,17,19-21,24,29-32,34-35,38-39, /
\r
26 // 42,46,50,52-54,56-59,61-62,64,68-69,71-80, /
\r
27 // 83-84,87-89,91,94-95,98,100,104-105,108-109, /
\r
28 // 112-115,118-126 /
\r
29 // Not checked = 6,16,25-26,43,65,70,90,99,103,106-107,110, /
\r
31 // List file = C:\home\kevin\pub\src\bc100\IAR\Release\List\m /
\r
35 ///////////////////////////////////////////////////////////////////////////////
\r
39 RSEG CSTACK:DATA:NOROOT(0)
\r
40 RSEG RSTACK:DATA:NOROOT(0)
\r
48 EXTERN BatteryControl
\r
55 // C:\home\kevin\pub\src\bc100\IAR\menu.c
\r
56 // 1 /* This file has been prepared for Doxygen automatic documentation generation.*/
\r
57 // 2 /*! \file *********************************************************************
\r
60 // 5 * State menu definition
\r
62 // 7 * Contains the definition of the state menu.\n
\r
63 // 8 * The state menu contains all states and adresses to associated functions.
\r
65 // 10 * \par Application note:
\r
66 // 11 * AVR458: Charging Li-Ion Batteries with BC100 \n
\r
67 // 12 * AVR463: Charging NiMH Batteries with BC100
\r
69 // 14 * \par Documentation:
\r
70 // 15 * For comprehensive code documentation, supported compilers, compiler
\r
71 // 16 * settings and supported devices see readme.html
\r
74 // 19 * Atmel Corporation: http://www.atmel.com \n
\r
75 // 20 * Support email: avr@atmel.com
\r
79 // 24 * $Revision: 2299 $
\r
81 // 26 * $URL: http://svn.norway.atmel.com/AppsAVR8/avr458_Charging_Li-Ion_Batteries_with_BC100/tag/20070904_release_1.0/code/IAR/menu.c $
\r
82 // 27 * $Date: 2007-08-23 12:55:51 +0200 (to, 23 aug 2007) $\n
\r
83 // 28 ******************************************************************************/
\r
85 // 30 #include <stdlib.h>
\r
87 // 32 #include "statefunc.h"
\r
88 // 33 #include "charge.h"
\r
89 // 34 #include "main.h"
\r
90 // 35 #include "menu.h"
\r
93 // 38 //******************************************************************************
\r
94 // 39 // State menu (relies on the proper battery type to be defined in main.h!)
\r
95 // 40 //******************************************************************************
\r
97 // 42 /*! \brief The state menu
\r
99 // 44 * Contains all the defined states and addresses to their associated functions.
\r
102 RSEG NEAR_F:CODE:NOROOT(0)
\r
103 // 46 __flash const MENU_STATE_t menu_state[] = {
\r
108 DW BatteryControl/2
\r
126 ASEGN ABSOLUTE:DATA:NOROOT,01cH
\r
129 ASEGN ABSOLUTE:DATA:NOROOT,01dH
\r
132 ASEGN ABSOLUTE:DATA:NOROOT,01eH
\r
135 ASEGN ABSOLUTE:DATA:NOROOT,01fH
\r
139 // 47 // State State function
\r
140 // 48 { ST_INIT, Initialize},
\r
141 // 49 { ST_BATCON, BatteryControl},
\r
142 // 50 { ST_PREQUAL, Charge},
\r
143 // 51 { ST_SLEEP, Sleep},
\r
144 // 52 { ST_FASTCHARGE, Charge},
\r
145 // 53 { ST_LOWRATECHARGE, Charge},
\r
146 // 54 { ST_ENDCHARGE, Charge},
\r
147 // 55 { ST_DISCHARGE, Discharge},
\r
148 // 56 { ST_ERROR, Error},
\r
151 // 59 #endif // NIMH
\r
154 // 62 /*! \brief The state menu
\r
156 // 64 * Contains all the defined states and addresses to their associated functions.
\r
158 // 66 __flash const MENU_STATE_t menu_state[] = {
\r
159 // 67 // State State function
\r
160 // 68 { ST_INIT, Initialize},
\r
161 // 69 { ST_BATCON, BatteryControl},
\r
162 // 70 { ST_PREQUAL, Charge},
\r
163 // 71 { ST_SLEEP, Sleep},
\r
164 // 72 { ST_CCURRENT, Charge},
\r
165 // 73 { ST_CVOLTAGE, Charge},
\r
166 // 74 { ST_ENDCHARGE, Charge},
\r
167 // 75 { ST_DISCHARGE, Discharge},
\r
168 // 76 { ST_ERROR, Error},
\r
171 // 79 #endif // LIION
\r
173 // 30 bytes in segment NEAR_F
\r
175 // 30 bytes of CODE memory
\r