fw: Simplify logic

Switch on state, then read commands specifically in the states that
allow reading of commands, then switch on specific command.
This commit is contained in:
Michael Cardell Widerkrantz 2023-03-09 14:11:43 +01:00 committed by Daniel Lublin
parent 7a97f1ee5f
commit 4e3f5469ef
No known key found for this signature in database
GPG key ID: 75BD0FEB8D3E7830
4 changed files with 206 additions and 196 deletions

View file

@ -0,0 +1,16 @@
/*
* Copyright (C) 2023 - Tillitis AB
* SPDX-License-Identifier: GPL-2.0-only
*/
#ifndef STATE_H
#define STATE_H
enum state {
FW_STATE_INITIAL,
FW_STATE_LOADING,
FW_STATE_RUN,
FW_STATE_FAIL,
FW_STATE_MAX,
};
#endif