~ruther/CTU-FEE-B0B35APO-Semestral-project

ec85f1d1636345067b1f5ed2b19c42d8c2603878 — František Boháček 3 years ago 50cf319
feat: add commands save and restore states
1 files changed, 9 insertions(+), 0 deletions(-)

M lib-pheripherals/src/input.c
M lib-pheripherals/src/input.c => lib-pheripherals/src/input.c +9 -0
@@ 173,3 173,12 @@ int16_t commands_check_input(commands_t * commands) {

  return commands_executed;
}

uint16_t commands_save_state(commands_t *commands) {
  return commands->count;
}

bool commands_restore_state(commands_t *commands, uint16_t state) {
  commands->count = state; // any destruction is not needed as everything is on stack and will be rewritten by new commands
  return true;
}

Do not follow this link