FreeCalypso > hg > fc-magnetite
annotate src/cs/drivers/drv_app/fchg/fchg_api.c @ 337:0df0668f8bea
FCHG: task core function implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 14 Dec 2017 21:47:40 +0000 |
parents | be011556e71f |
children | 3a7810ca74e2 |
rev | line source |
---|---|
336
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * The implementation of our external API functions lives here. |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include "fchg/fchg_api.h" |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include "fchg/fchg_env.h" |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include "fchg/fchg_messages.h" |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include "rv/rv_general.h" |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include "rvf/rvf_api.h" |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include "rvm/rvm_use_id_list.h" |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 T_RV_RET fchg_get_current_state(struct fchg_user_state *rstruct) |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 rstruct->chg_state = pwr_ctrl->state; |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 rstruct->batt_mv = pwr_ctrl->batt_mv; |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 rstruct->batt_percent = |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 pwr_ctrl->batt_thresholds[pwr_ctrl->curr_disch_thresh].remain_capa; |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 return RV_OK; |
be011556e71f
FCHG: API implementation started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 } |