FreeCalypso > hg > fc-tourmaline
comparison src/cs/drivers/drv_app/fchg/fchg_task.c @ 256:aec644728174
FCHG BSIM: ETM connection implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 13 May 2021 02:37:14 +0000 |
parents | 4533ef63fdb0 |
children |
comparison
equal
deleted
inserted
replaced
255:1a4413c4eb7e | 256:aec644728174 |
---|---|
2 * The FCHG task's core function lives here. | 2 * The FCHG task's core function lives here. |
3 */ | 3 */ |
4 | 4 |
5 #include "fchg/fchg_env.h" | 5 #include "fchg/fchg_env.h" |
6 #include "fchg/fchg_func_i.h" | 6 #include "fchg/fchg_func_i.h" |
7 #include "fchg/bsim_func_i.h" | |
7 #include "rv/rv_general.h" | 8 #include "rv/rv_general.h" |
8 #include "rvf/rvf_api.h" | 9 #include "rvf/rvf_api.h" |
9 #include "rvm/rvm_use_id_list.h" | 10 #include "rvm/rvm_use_id_list.h" |
10 #include "abb/abb.h" | 11 #include "abb/abb.h" |
12 #include "etm/etm.h" | |
13 #include "etm/etm_api.h" | |
11 | 14 |
12 static void set_initial_state(void) | 15 static void set_initial_state(void) |
13 { | 16 { |
14 SYS_UWORD16 abb_status; | 17 SYS_UWORD16 abb_status; |
15 | 18 |
35 if (!pwr_ctrl->bsim_mode) | 38 if (!pwr_ctrl->bsim_mode) |
36 pwr_load_ffs_charging_config(); | 39 pwr_load_ffs_charging_config(); |
37 set_initial_state(); | 40 set_initial_state(); |
38 /* just for safety, clear any previous BCI hardware state */ | 41 /* just for safety, clear any previous BCI hardware state */ |
39 ABB_Write_Register_on_page(PAGE0, BCICTL2, 0); | 42 ABB_Write_Register_on_page(PAGE0, BCICTL2, 0); |
40 if (pwr_ctrl->bsim_mode) | 43 if (pwr_ctrl->bsim_mode) { |
41 bsim_init_percent(); | 44 bsim_init_percent(); |
42 else | 45 etm_register("BSIM", ETM_BSIM, 0, pwr_ctrl->addr_id, 0); |
46 } else | |
43 pwr_init_discharge(); | 47 pwr_init_discharge(); |
44 | 48 |
45 /* loop to process messages */ | 49 /* loop to process messages */ |
46 while (error_occured == FALSE) | 50 while (error_occured == FALSE) |
47 { | 51 { |