FreeCalypso > hg > fc-tourmaline
comparison src/cs/drivers/drv_app/fchg/fchg_task.c @ 236:3c790d29748e
fchg_is_running startup sync flag change:
set the flag when the first ADC message has been processed,
and not merely when the task is running - this way the flag indicates
that meaningful info about the state of the battery is available.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 02 May 2021 04:25:48 +0000 |
parents | c336ed5691a5 |
children | 769cf6273fe4 |
comparison
equal
deleted
inserted
replaced
235:ee04ca45053d | 236:3c790d29748e |
---|---|
6 #include "fchg/fchg_func_i.h" | 6 #include "fchg/fchg_func_i.h" |
7 #include "rv/rv_general.h" | 7 #include "rv/rv_general.h" |
8 #include "rvf/rvf_api.h" | 8 #include "rvf/rvf_api.h" |
9 #include "rvm/rvm_use_id_list.h" | 9 #include "rvm/rvm_use_id_list.h" |
10 #include "abb/abb.h" | 10 #include "abb/abb.h" |
11 | |
12 /* startup synchronization with MMI task in GPF land */ | |
13 int fchg_is_running; | |
14 | 11 |
15 static void set_initial_state(void) | 12 static void set_initial_state(void) |
16 { | 13 { |
17 SYS_UWORD16 abb_status; | 14 SYS_UWORD16 abb_status; |
18 | 15 |
37 pwr_load_ffs_charging_config(); | 34 pwr_load_ffs_charging_config(); |
38 set_initial_state(); | 35 set_initial_state(); |
39 /* just for safety, clear any previous BCI hardware state */ | 36 /* just for safety, clear any previous BCI hardware state */ |
40 ABB_Write_Register_on_page(PAGE0, BCICTL2, 0); | 37 ABB_Write_Register_on_page(PAGE0, BCICTL2, 0); |
41 pwr_init_discharge(); | 38 pwr_init_discharge(); |
42 fchg_is_running = 1; | |
43 | 39 |
44 /* loop to process messages */ | 40 /* loop to process messages */ |
45 while (error_occured == FALSE) | 41 while (error_occured == FALSE) |
46 { | 42 { |
47 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */ | 43 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */ |