diff options
| author | Nick Moore <nicholasvmoore@gmail.com> | 2026-04-22 07:42:03 -0500 |
|---|---|---|
| committer | Nick Moore <nicholasvmoore@gmail.com> | 2026-04-22 07:42:03 -0500 |
| commit | 7fc0485f8e5bdcaf069d0cb833c51b010b9e0816 (patch) | |
| tree | e7030b32025f88d2a62bb137dd3593df8600bf2a /components/sign_logic/sign_logic.c | |
| parent | 8f5ed4b452deddfc285a9e3e5bd5ce2ccce6c74b (diff) | |
Diffstat (limited to 'components/sign_logic/sign_logic.c')
| -rw-r--r-- | components/sign_logic/sign_logic.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/components/sign_logic/sign_logic.c b/components/sign_logic/sign_logic.c new file mode 100644 index 0000000..a8ceb0b --- /dev/null +++ b/components/sign_logic/sign_logic.c @@ -0,0 +1,25 @@ +#include <stddef.h> + +#include "sign_logic.h" + +sign_result_t sign_set_on_air(sign_state_t *state, bool on_air) { + if (state == NULL) { + return SIGN_ERR_NULL; + } + + state->is_on_air = on_air; + return SIGN_OK; +} + +sign_result_t sign_set_brightness(sign_state_t *state, uint8_t brightness) { + if (state == NULL) { + return SIGN_ERR_NULL; + } + + if (brightness > SIGN_BRIGHTNESS_MAX) { + return SIGN_ERR_RANGE; + } + + state->brightness = brightness; + return SIGN_OK; +} |
