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) { switch (nr) {
#ifdef PIN_SIM_SWITCH1 #ifdef PIN_SIM_SWITCH1
case 1: case 0:
pin = &pin_conn_usim1; pin = &pin_conn_usim1;
break; break;
#endif #endif
#ifdef PIN_SIM_SWITCH2 #ifdef PIN_SIM_SWITCH2
case 2: case 1:
pin = &pin_conn_usim2; pin = &pin_conn_usim2;
break; break;
#endif #endif

View File

@@ -184,17 +184,17 @@ void board_exec_dbg_cmd(int ch)
break; break;
case '1': case '1':
printf("Resetting Modem 1 (of this SAM3)\n\r"); printf("Resetting Modem 1 (of this SAM3)\n\r");
wwan_perst_do_reset_pulse(1, 300); wwan_perst_do_reset_pulse(0, 300);
break; break;
case '2': case '2':
printf("Resetting Modem 2 (of this SAM3)\n\r"); printf("Resetting Modem 2 (of this SAM3)\n\r");
wwan_perst_do_reset_pulse(2, 300); wwan_perst_do_reset_pulse(1, 300);
break; break;
case '!': case '!':
sim_switch_use_physical(1, 0); sim_switch_use_physical(0, 0);
break; break;
case '@': case '@':
sim_switch_use_physical(2, 0); sim_switch_use_physical(0, 0);
break; break;
default: default:
if (!qmod_sam3_is_12()) 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) { switch (modem_nr) {
#ifdef PIN_PERST1 #ifdef PIN_PERST1
case 1: case 0:
return &perst1; return &perst1;
#endif #endif
#ifdef PIN_PERST2 #ifdef PIN_PERST2
case 2: case 1:
return &perst2; return &perst2;
#endif #endif
default: default: