Tested last changes, here are needed fixes
This commit is contained in:
parent
dff933b16b
commit
8b018f1930
|
@ -72,10 +72,14 @@ void setup() {
|
||||||
// Setup background tasks
|
// Setup background tasks
|
||||||
tasks::setCallback(update);
|
tasks::setCallback(update);
|
||||||
|
|
||||||
|
// Make sure we don't start with a mode change
|
||||||
|
selector::changed();
|
||||||
|
|
||||||
// Start attack
|
// Start attack
|
||||||
if (selector::mode() == ATTACK && !preferences::getRunOnIndicator()) {
|
if (selector::mode() == ATTACK && !preferences::getRunOnIndicator()) {
|
||||||
delay(preferences::getInitialDelay()); // Wait to give computer time to init keyboard
|
delay(preferences::getInitialDelay()); // Wait to give computer time to init keyboard
|
||||||
attack::start(); // Start keystroke injection attack
|
attack::start(); // Start keystroke injection attack
|
||||||
|
led::setColor(preferences::getIdleColor()); // Set LED to green
|
||||||
}
|
}
|
||||||
|
|
||||||
started = true;
|
started = true;
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace duckparser {
|
||||||
unsigned long sleep_time = 0;
|
unsigned long sleep_time = 0;
|
||||||
|
|
||||||
void type(const char* str, size_t len) {
|
void type(const char* str, size_t len) {
|
||||||
for (size_t i = 0; i < len; ++i) {
|
for (size_t i=0; i<len; ++i) {
|
||||||
i += keyboard::write(&str[i]);
|
i += keyboard::write(&str[i]);
|
||||||
tasks::update();
|
tasks::update();
|
||||||
}
|
}
|
||||||
|
@ -153,8 +153,7 @@ namespace duckparser {
|
||||||
unsigned long sleep_end_time = sleep_start_time + time;
|
unsigned long sleep_end_time = sleep_start_time + time;
|
||||||
|
|
||||||
while (millis() < sleep_end_time) {
|
while (millis() < sleep_end_time) {
|
||||||
//delay(1);
|
delay(1);
|
||||||
yield();
|
|
||||||
tasks::update();
|
tasks::update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,9 @@ namespace hid {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait until ready to send next report
|
// Wait until ready to send next report
|
||||||
while (!usb_hid.ready());
|
while (!usb_hid.ready()){
|
||||||
|
delay(1);
|
||||||
|
}
|
||||||
|
|
||||||
usb_hid.keyboardReport(RID::KEYBOARD, modifier, keys);
|
usb_hid.keyboardReport(RID::KEYBOARD, modifier, keys);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace selector {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool changed() {
|
bool changed() {
|
||||||
if(change_flag && millis() - change_time > CHANGE_DELAY) {
|
if(change_flag && (millis() - change_time) > CHANGE_DELAY) {
|
||||||
change_flag = false;
|
change_flag = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue