Tested last changes, here are needed fixes

This commit is contained in:
Spacehuhn 2022-07-17 00:39:48 +02:00
parent dff933b16b
commit 8b018f1930
4 changed files with 10 additions and 5 deletions

View File

@ -72,10 +72,14 @@ void setup() {
// Setup background tasks
tasks::setCallback(update);
// Make sure we don't start with a mode change
selector::changed();
// Start attack
if (selector::mode() == ATTACK && !preferences::getRunOnIndicator()) {
delay(preferences::getInitialDelay()); // Wait to give computer time to init keyboard
attack::start(); // Start keystroke injection attack
led::setColor(preferences::getIdleColor()); // Set LED to green
}
started = true;

View File

@ -32,7 +32,7 @@ namespace duckparser {
unsigned long sleep_time = 0;
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]);
tasks::update();
}
@ -153,8 +153,7 @@ namespace duckparser {
unsigned long sleep_end_time = sleep_start_time + time;
while (millis() < sleep_end_time) {
//delay(1);
yield();
delay(1);
tasks::update();
}
}

View File

@ -84,7 +84,9 @@ namespace hid {
}
// Wait until ready to send next report
while (!usb_hid.ready());
while (!usb_hid.ready()){
delay(1);
}
usb_hid.keyboardReport(RID::KEYBOARD, modifier, keys);
}

View File

@ -37,7 +37,7 @@ namespace selector {
}
bool changed() {
if(change_flag && millis() - change_time > CHANGE_DELAY) {
if(change_flag && (millis() - change_time) > CHANGE_DELAY) {
change_flag = false;
return true;
}