chg samyrun - dual leds flash after state changes

This commit is contained in:
iceman1001 2019-09-13 10:17:58 +02:00
commit 3a776ecf3a

View file

@ -78,7 +78,7 @@ void RunMod() {
WAIT_BUTTON_RELEASED(); WAIT_BUTTON_RELEASED();
// record // record
DbpString("[=] starting recording"); DbpString("[=] start recording");
// findone, high, low, no ledcontrol (A) // findone, high, low, no ledcontrol (A)
uint32_t hi = 0, lo = 0; uint32_t hi = 0, lo = 0;
@ -86,16 +86,16 @@ void RunMod() {
high[selected] = hi; high[selected] = hi;
low[selected] = lo; low[selected] = lo;
Dbprintf("[=] recorded bank %x | %x%08x", selected, high[selected], low[selected]); Dbprintf("[=] recorded %x | %x%08x", selected, high[selected], low[selected]);
// got nothing. blink and loop. // got nothing. blink and loop.
if ( hi == 0 && lo == 0 ) { if ( hi == 0 && lo == 0 ) {
SpinErr( (selected == 0) ? LED_A : LED_B, 100, 12); SpinErr( (selected == 0) ? LED_A : LED_B, 100, 12);
Dbprintf("[=] recorded nothing, looping"); DbpString("[=] only got zeros, retry recording after click");
continue; continue;
} }
SpinErr( (select==0) ? LED_A : LED_B, 250, 2); SpinErr( (selected == 0) ? LED_A : LED_B, 250, 2);
state = STATE_SIM; state = STATE_SIM;
continue; continue;
@ -109,7 +109,11 @@ void RunMod() {
// high, low, no led control(A) no time limit // high, low, no led control(A) no time limit
CmdHIDsimTAGEx(high[selected], low[selected], false, -1); CmdHIDsimTAGEx(high[selected], low[selected], false, -1);
SpinErr( LED_C, 250, 2);
DbpString("[=] simulating done");
uint8_t leds = ((selected == 0) ? LED_A : LED_B) | LED_C;
SpinErr( leds , 250, 2);
state = STATE_CLONE; state = STATE_CLONE;
continue; continue;
@ -123,13 +127,17 @@ void RunMod() {
// high2, high, low, no longFMT // high2, high, low, no longFMT
CopyHIDtoT55x7(0, high[selected], low[selected], 0); CopyHIDtoT55x7(0, high[selected], low[selected], 0);
DbpString("[=] cloned done");
state = STATE_READ; state = STATE_READ;
SpinErr( LED_D, 250, 2); uint8_t leds = ((selected == 0) ? LED_A : LED_B) | LED_D;
SpinErr(leds, 250, 2);
selected = (selected + 1) % OPTS; selected = (selected + 1) % OPTS;
LEDsoff(); LEDsoff();
} }
} }
DbpString("[=] exiting samyrun"); DbpString("[=] You can take shell back :) ...");
LEDsoff(); LEDsoff();
} }