Network commands port to userspace

This commit is contained in:
boreddevnl
2026-02-27 23:24:43 +01:00
parent 304c2e1383
commit 8a6928b5c9
22 changed files with 680 additions and 69 deletions

View File

@@ -191,17 +191,13 @@ static void calculator_click(int x, int y) {
if (calc_decimal_divisor > 10) {
calc_decimal_divisor /= 10;
long long unit = SCALE / calc_decimal_divisor;
// This removes the last decimal digit
calc_curr = (calc_curr / (unit * 10)) * (unit * 10);
} else {
// Backspace on the dot itself or first decimal
calc_decimal_mode = false;
calc_decimal_divisor = 10;
// Ensure the fractional part is cleared
calc_curr = (calc_curr / SCALE) * SCALE;
}
} else {
// Integer backspace: remove last digit of integer part
calc_curr = (calc_curr / SCALE / 10) * SCALE;
}
}
@@ -240,11 +236,9 @@ int main(void) {
calc_new_entry = true;
update_display();
// First paint
calculator_paint();
ui_mark_dirty(win_calculator, 0, 0, 180, 230);
// Check events from Kernel User Interface queue
gui_event_t ev;
while (1) {
if (ui_get_event(win_calculator, &ev)) {