mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-24 17:28:32 +03:00
cardem: Report the VCC voltage (if supported)
The SIMtrace2 protocol alwasy contained a field for the VCC voltage, the cardem firmware just never populated that field, even on those boards that use the ADC to determine its voltage. Change-Id: Idcecad553fb36380e916378e1420488acbbfa8e3
This commit is contained in:
@@ -168,6 +168,16 @@ static void card_emu_uart_set_direction(uint8_t uart_chan, bool tx)
|
||||
#endif
|
||||
}
|
||||
|
||||
int card_emu_get_vcc(uint8_t uart_chan)
|
||||
{
|
||||
struct cardem_inst *ci = &cardem_inst[uart_chan];
|
||||
#ifdef DETECT_VCC_BY_ADC
|
||||
return ci->vcc_uv / 1000;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* call-back from card_emu.c to enable/disable transmit and/or receive */
|
||||
void card_emu_uart_enable(uint8_t uart_chan, uint8_t rxtx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user