consistently use 0-based counting of modems/slots

This commit is contained in:
Harald Welte
2017-05-11 00:04:50 +02:00
parent b91f6ad848
commit 44622dfd8d
3 changed files with 8 additions and 8 deletions

View File

@@ -27,12 +27,12 @@ int sim_switch_use_physical(unsigned int nr, int physical)
switch (nr) {
#ifdef PIN_SIM_SWITCH1
case 1:
case 0:
pin = &pin_conn_usim1;
break;
#endif
#ifdef PIN_SIM_SWITCH2
case 2:
case 1:
pin = &pin_conn_usim2;
break;
#endif

View File

@@ -184,17 +184,17 @@ void board_exec_dbg_cmd(int ch)
break;
case '1':
printf("Resetting Modem 1 (of this SAM3)\n\r");
wwan_perst_do_reset_pulse(1, 300);
wwan_perst_do_reset_pulse(0, 300);
break;
case '2':
printf("Resetting Modem 2 (of this SAM3)\n\r");
wwan_perst_do_reset_pulse(2, 300);
wwan_perst_do_reset_pulse(1, 300);
break;
case '!':
sim_switch_use_physical(1, 0);
sim_switch_use_physical(0, 0);
break;
case '@':
sim_switch_use_physical(2, 0);
sim_switch_use_physical(0, 0);
break;
default:
if (!qmod_sam3_is_12())

View File

@@ -45,11 +45,11 @@ static struct wwan_perst *get_perst_for_modem(int modem_nr)
switch (modem_nr) {
#ifdef PIN_PERST1
case 1:
case 0:
return &perst1;
#endif
#ifdef PIN_PERST2
case 2:
case 1:
return &perst2;
#endif
default: