FreeCalypso > hg > fc-magnetite
view src/g23m-aci/aci/ati_fchg.c @ 635:baa0a02bc676
niq32.c DTR handling restored for targets that have it
TI's original TCS211 fw treated GPIO 3 as the DTR input (wired so on C-Sample
and D-Sample boards, also compatible with Leonardo and FCDEV3B which have a
fixed pull-down resistor on this GPIO line), and the code in niq32.c called
UAF_DTRInterruptHandler() (implemented in uartfax.c) from the
IQ_KeypadGPIOHandler() function. But on Openmoko's GTA02 with their official
fw this GPIO is a floating input, all of the DTR handling code in uartfax.c
including the interrupt logic is still there, but the hobbled TCS211-20070608
semi-src delivery which OM got from TI contained a change in niq32.c (which
had been kept in FC until now) that removed the call to
UAF_DTRInterruptHandler() as part of those not-quite-understood "CC test"
hacks.
The present change fixes this bug at a long last: if we are building fw for a
target that has TI's "classic" DTR & DCD GPIO arrangement (dsample, fcmodem and
gtm900), we bring back all of TI's original code in both uartfax.c and niq32.c,
whereas if we are building fw for a target that does not use this classic GPIO
arrangement, the code in niq32.c goes back to what we got from OM and all
DTR & DCD code in uartfax.c is conditioned out. This change also removes the
very last remaining bit of "CC test" bogosity from our FreeCalypso code base.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 19 Jan 2020 01:41:35 +0000 |
parents | adae731ae50d |
children |
line wrap: on
line source
/* * The non-standard FreeCalypso-added AT commands implemented in this module * expose the API of FreeCalypso battery charging driver FCHG. */ #ifndef ATI_FCHG_C #define ATI_FCHG_C #include "aci_all.h" #include <ctype.h> #include <string.h> #include "aci_cmh.h" #include "ati_cmd.h" #include "aci_cmd.h" #include "aci_io.h" #include "aci_cmd.h" #include "l4_tim.h" #include "line_edit.h" #include "aci_lst.h" #include "pcm.h" #include "audio.h" #include "aci.h" #include "rx.h" #include "pwr.h" #include "l4_tim.h" #ifdef GPRS #ifdef DTI #include "dti.h" #include "dti_conn_mng.h" #include "dti_cntrl_mng.h" #endif /* DTI */ #include "gaci.h" #include "gaci_cmh.h" #include "gaci_cmd.h" #endif /* GPRS */ #include "aci_mem.h" #include "aci_prs.h" #include "ati_int.h" #ifndef _SIMULATION_ #include "ffs/ffs.h" #endif #ifdef FF_ATI_BAT #include "typedefs.h" #include "gdd.h" #include "bat.h" #include "ati_bat.h" #endif /*FF_ATI_BAT*/ #include "rv/rv_defined_swe.h" // for RVM_FCHG_SWE #ifdef RVM_FCHG_SWE #include "fchg/fchg_api.h" /* AT%CBC - customized alternative to standard AT+CBC */ GLOBAL T_ATI_RSLT atPercentCBC ( char *cl, UBYTE srcId ) { struct fchg_user_state fchg; TRACE_FUNCTION("atPercentCBC()"); if (fchg_get_current_state(&fchg) != RV_OK) return ATI_FAIL; sprintf(g_sa, "%%CBC: %d,%d,%d", fchg.chg_state, fchg.batt_mv, fchg.batt_percent); io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); return ATI_CMPL; } /* AT@CHG - manual control of battery charging */ GLOBAL T_ATI_RSLT atAtCHG ( char *cl, UBYTE srcId ) { enum fchg_user_charge_ctrl ctrl; TRACE_FUNCTION("atAtCHG()"); cl = parse(cl, "D", &ctrl); if (!cl) return ATI_FAIL; if (fchg_user_charge_control(ctrl) == RV_OK) return ATI_CMPL; else return ATI_FAIL; } #endif /* RVM_FCHG_SWE */ /* AT%VBAT - retrieve VBAT measurement, independent of FCHG */ GLOBAL T_ATI_RSLT atPercentVBAT ( char *cl, UBYTE srcId ) { extern USHORT *csf_return_adc(void); USHORT *adc_conversion; TRACE_FUNCTION("atPercentVBAT()"); adc_conversion = csf_return_adc(); sprintf(g_sa, "%%VBAT: %u", adc_conversion[0]); io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); return ATI_CMPL; } #endif /* ATI_FCHG_C */