############################################################################### # # # IAR Atmel AVR C/C++ Compiler V4.30F/W32 13/Mar/2008 04:49:38 # # Copyright 1996-2007 IAR Systems. All rights reserved. # # # # Source file = C:\home\kevin\pub\src\bc100\IAR\menu.c # # Command line = C:\home\kevin\pub\src\bc100\IAR\menu.c # # --cpu=tiny861 -ms -o C:\home\kevin\pub\src\bc10 # # 0\IAR\Release\Obj\ -D NDEBUG -lCN # # C:\home\kevin\pub\src\bc100\IAR\Release\List\ # # -lB C:\home\kevin\pub\src\bc100\IAR\Release\Lis # # t\ --initializers_in_flash -s9 --no_cross_call # # --no_tbaa -DENABLE_BIT_DEFINITIONS -e -I # # "C:\Program Files\IAR Systems\Embedded # # Workbench 4.0\avr\INC\" -I "C:\Program # # Files\IAR Systems\Embedded Workbench # # 4.0\avr\INC\CLIB\" --eeprom_size 512 # # --misrac=5-9,11-12,14,16-17,19-21,24-26,29-32, # # 34-35,38-39,42-43,46,50,52-54,56-59,61-62, # # 64-65,68-80,83-84,87-91,94-95,98-100,103-110, # # 112-126 # # Enabled MISRA C rules = 5-9,11-12,14,16-17,19-21,24-26,29-32,34-35, # # 38-39,42-43,46,50,52-54,56-59,61-62,64-65, # # 68-80,83-84,87-91,94-95,98-100,103-110,112-126 # # Checked = 5,7-9,11-12,14,17,19-21,24,29-32,34-35,38-39, # # 42,46,50,52-54,56-59,61-62,64,68-69,71-80, # # 83-84,87-89,91,94-95,98,100,104-105,108-109, # # 112-115,118-126 # # Not checked = 6,16,25-26,43,65,70,90,99,103,106-107,110, # # 116-117 # # List file = C:\home\kevin\pub\src\bc100\IAR\Release\List\me # # nu.lst # # Object file = C:\home\kevin\pub\src\bc100\IAR\Release\Obj\men # # u.r90 # # # # # ############################################################################### C:\home\kevin\pub\src\bc100\IAR\menu.c 1 /* This file has been prepared for Doxygen automatic documentation generation.*/ 2 /*! \file ********************************************************************* 3 * 4 * \brief 5 * State menu definition 6 * 7 * Contains the definition of the state menu.\n 8 * The state menu contains all states and adresses to associated functions. 9 * 10 * \par Application note: 11 * AVR458: Charging Li-Ion Batteries with BC100 \n 12 * AVR463: Charging NiMH Batteries with BC100 13 * 14 * \par Documentation: 15 * For comprehensive code documentation, supported compilers, compiler 16 * settings and supported devices see readme.html 17 * 18 * \author 19 * Atmel Corporation: http://www.atmel.com \n 20 * Support email: avr@atmel.com 21 * 22 * 23 * $Name$ 24 * $Revision: 2299 $ 25 * $RCSfile$ 26 * $URL: http://svn.norway.atmel.com/AppsAVR8/avr458_Charging_Li-Ion_Batteries_with_BC100/tag/20070904_release_1.0/code/IAR/menu.c $ 27 * $Date: 2007-08-23 12:55:51 +0200 (to, 23 aug 2007) $\n 28 ******************************************************************************/ 29 30 #include 31 32 #include "statefunc.h" 33 #include "charge.h" 34 #include "main.h" 35 #include "menu.h" 36 37 38 //****************************************************************************** 39 // State menu (relies on the proper battery type to be defined in main.h!) 40 //****************************************************************************** 41 #ifdef NIMH 42 /*! \brief The state menu 43 * 44 * Contains all the defined states and addresses to their associated functions. 45 */ \ In segment NEAR_F, align 1, keep-with-next 46 __flash const MENU_STATE_t menu_state[] = { \ menu_state: \ 00000000 0A DB 10 \ 00000001 .... DW Initialize/2 \ 00000003 14 DB 20 \ 00000004 .... DW BatteryControl/2 \ 00000006 1E DB 30 \ 00000007 .... DW Charge/2 \ 00000009 28 DB 40 \ 0000000A .... DW `Sleep`/2 \ 0000000C 32 DB 50 \ 0000000D .... DW Charge/2 \ 0000000F 3C DB 60 \ 00000010 .... DW Charge/2 \ 00000012 46 DB 70 \ 00000013 .... DW Charge/2 \ 00000015 50 DB 80 \ 00000016 .... DW Discharge/2 \ 00000018 5A DB 90 \ 00000019 .... DW Error/2 \ 0000001B 00 DB 0 \ 0000001C 0000 DW 0H 47 // State State function 48 { ST_INIT, Initialize}, 49 { ST_BATCON, BatteryControl}, 50 { ST_PREQUAL, Charge}, 51 { ST_SLEEP, Sleep}, 52 { ST_FASTCHARGE, Charge}, 53 { ST_LOWRATECHARGE, Charge}, 54 { ST_ENDCHARGE, Charge}, 55 { ST_DISCHARGE, Discharge}, 56 { ST_ERROR, Error}, 57 { 0, NULL}, 58 }; 59 #endif // NIMH 60 61 #ifdef LIION 62 /*! \brief The state menu 63 * 64 * Contains all the defined states and addresses to their associated functions. 65 */ 66 __flash const MENU_STATE_t menu_state[] = { 67 // State State function 68 { ST_INIT, Initialize}, 69 { ST_BATCON, BatteryControl}, 70 { ST_PREQUAL, Charge}, 71 { ST_SLEEP, Sleep}, 72 { ST_CCURRENT, Charge}, 73 { ST_CVOLTAGE, Charge}, 74 { ST_ENDCHARGE, Charge}, 75 { ST_DISCHARGE, Discharge}, 76 { ST_ERROR, Error}, 77 { 0, NULL}, 78 }; 79 #endif // LIION Segment part sizes: Function/Label Bytes -------------- ----- menu_state 30 30 bytes in segment NEAR_F 30 bytes of CODE memory Errors: none Warnings: none