mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-16 04:24:45 -07:00
Update TOTP / run fbt format
This commit is contained in:
13
applications/external/bomberduck/bomberduck.c
vendored
13
applications/external/bomberduck/bomberduck.c
vendored
@@ -21,7 +21,6 @@ int min(int a, int b) {
|
||||
#define WorldSizeY 6
|
||||
#define BombRange 1
|
||||
|
||||
|
||||
typedef struct {
|
||||
FuriMutex* mutex;
|
||||
} BomberState;
|
||||
@@ -191,7 +190,6 @@ static const NotificationSequence vibr1 = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
void intToStr(int num, char* str) {
|
||||
int i = 0, sign = 0;
|
||||
|
||||
@@ -524,13 +522,18 @@ int32_t bomberduck_app(void* p) {
|
||||
world.bombs[j] = world.bombs[j + 1];
|
||||
}
|
||||
world.bombs_count--;
|
||||
} else if(furi_get_tick() - world.bombs[i].planted > (unsigned long)max((3000 - world.level * 150)*2/3, 666)&&world.matrix[world.bombs[i].y][world.bombs[i].x]!=5) {
|
||||
} else if(
|
||||
furi_get_tick() - world.bombs[i].planted >
|
||||
(unsigned long)max((3000 - world.level * 150) * 2 / 3, 666) &&
|
||||
world.matrix[world.bombs[i].y][world.bombs[i].x] != 5) {
|
||||
world.matrix[world.bombs[i].y][world.bombs[i].x] = 5;
|
||||
vibration = true;
|
||||
|
||||
} else if(furi_get_tick() - world.bombs[i].planted > (unsigned long)max((3000 - world.level * 150)/3, 333)&& world.matrix[world.bombs[i].y][world.bombs[i].x]!=4) {
|
||||
} else if(
|
||||
furi_get_tick() - world.bombs[i].planted >
|
||||
(unsigned long)max((3000 - world.level * 150) / 3, 333) &&
|
||||
world.matrix[world.bombs[i].y][world.bombs[i].x] != 4) {
|
||||
world.matrix[world.bombs[i].y][world.bombs[i].x] = 4;
|
||||
|
||||
}
|
||||
}
|
||||
for(int e = 0; e < world.enemies_count; e++) {
|
||||
|
||||
@@ -109,7 +109,6 @@ static void hid_ytshorts_draw_callback(Canvas* canvas, void* context) {
|
||||
elements_multiline_text_aligned(canvas, 13, 62, AlignLeft, AlignBottom, "Hold to exit");
|
||||
}
|
||||
|
||||
|
||||
static void hid_ytshorts_reset_cursor(HidYTShorts* hid_ytshorts) {
|
||||
// Set cursor to the phone's left up corner
|
||||
// Delays to guarantee one packet per connection interval
|
||||
|
||||
@@ -30,7 +30,7 @@ static uint32_t get_keypress_delay(TokenAutomationFeature features) {
|
||||
}
|
||||
|
||||
static void totp_type_code_worker_press_key(
|
||||
uint8_t key,
|
||||
uint16_t key,
|
||||
TOTP_AUTOMATION_KEY_HANDLER key_press_fn,
|
||||
TOTP_AUTOMATION_KEY_HANDLER key_release_fn,
|
||||
TokenAutomationFeature features) {
|
||||
@@ -47,8 +47,6 @@ void totp_type_code_worker_execute_automation(
|
||||
TokenAutomationFeature features) {
|
||||
furi_delay_ms(500);
|
||||
uint8_t i = 0;
|
||||
totp_type_code_worker_press_key(
|
||||
HID_KEYBOARD_CAPS_LOCK, key_press_fn, key_release_fn, features);
|
||||
|
||||
while(i < code_buffer_size && code_buffer[i] != 0) {
|
||||
uint8_t char_index = CONVERT_CHAR_TO_DIGIT(code_buffer[i]);
|
||||
@@ -58,7 +56,11 @@ void totp_type_code_worker_execute_automation(
|
||||
|
||||
if(char_index > 35) break;
|
||||
|
||||
uint8_t hid_kb_key = hid_number_keys[char_index];
|
||||
uint16_t hid_kb_key = hid_number_keys[char_index];
|
||||
if(char_index > 9) {
|
||||
hid_kb_key |= KEY_MOD_LEFT_SHIFT;
|
||||
}
|
||||
|
||||
totp_type_code_worker_press_key(hid_kb_key, key_press_fn, key_release_fn, features);
|
||||
furi_delay_ms(get_keystroke_delay(features));
|
||||
i++;
|
||||
@@ -74,7 +76,4 @@ void totp_type_code_worker_execute_automation(
|
||||
furi_delay_ms(get_keystroke_delay(features));
|
||||
totp_type_code_worker_press_key(HID_KEYBOARD_TAB, key_press_fn, key_release_fn, features);
|
||||
}
|
||||
|
||||
totp_type_code_worker_press_key(
|
||||
HID_KEYBOARD_CAPS_LOCK, key_press_fn, key_release_fn, features);
|
||||
}
|
||||
Reference in New Issue
Block a user