mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
perst/sim_switch: Log events using TRACE_INFO
This commit is contained in:
@@ -41,10 +41,13 @@ int sim_switch_use_physical(unsigned int nr, int physical)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (physical)
|
if (physical) {
|
||||||
|
TRACE_INFO("%u: Use local/physical SIM\r\n", nr);
|
||||||
PIO_Clear(pin);
|
PIO_Clear(pin);
|
||||||
else
|
} else {
|
||||||
|
TRACE_INFO("%u: Use remote/emulated SIM\r\n", nr);
|
||||||
PIO_Set(pin);
|
PIO_Set(pin);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
#include "trace.h"
|
||||||
#include "wwan_perst.h"
|
#include "wwan_perst.h"
|
||||||
#include "osmocom/core/timer.h"
|
#include "osmocom/core/timer.h"
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ static void perst_tmr_cb(void *data)
|
|||||||
{
|
{
|
||||||
struct wwan_perst *perst = data;
|
struct wwan_perst *perst = data;
|
||||||
/* release the (low-active) reset */
|
/* release the (low-active) reset */
|
||||||
|
TRACE_INFO("De-asserting modem reset\r\n");
|
||||||
PIO_Clear(&perst->pin);
|
PIO_Clear(&perst->pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +65,7 @@ int wwan_perst_do_reset_pulse(int modem_nr, unsigned int duration_ms)
|
|||||||
if (!perst)
|
if (!perst)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
TRACE_INFO("%u: Asserting modem reset\r\n", modem_nr);
|
||||||
PIO_Set(&perst->pin);
|
PIO_Set(&perst->pin);
|
||||||
osmo_timer_schedule(&perst->timer, duration_ms/1000, (duration_ms%1000)*1000);
|
osmo_timer_schedule(&perst->timer, duration_ms/1000, (duration_ms%1000)*1000);
|
||||||
|
|
||||||
@@ -76,10 +79,13 @@ int wwan_perst_set(int modem_nr, int active)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
osmo_timer_del(&perst->timer);
|
osmo_timer_del(&perst->timer);
|
||||||
if (active)
|
if (active) {
|
||||||
|
TRACE_INFO("%u: Asserting modem reset\r\n", modem_nr);
|
||||||
PIO_Set(&perst->pin);
|
PIO_Set(&perst->pin);
|
||||||
else
|
} else {
|
||||||
|
TRACE_INFO("%u: De-asserting modem reset\r\n", modem_nr);
|
||||||
PIO_Clear(&perst->pin);
|
PIO_Clear(&perst->pin);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user