Embedded System Design 2 - Project
|
Utility functionality. More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | ERROR_FORWARDING 1 |
Functions | |
void | led (bool enabled) |
Enable or disable the LED. More... | |
void | error (uint8_t number) |
Error method. More... | |
Utility functionality.
Copyright (C) 2019 - Brecht Van Eeckhoudt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A copy of the GNU General Public License can be found in the LICENSE
file along with this source code.
Some methods use code obtained from examples from Silicon Labs' GitHub. These sections are licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.
Definition in file util.h.
#define ERROR_FORWARDING 1 |
Public definition to enable/disable the logic to send certain error call values (everything except 30 - 50) to the cloud using LoRaWAN.
0
- Keep the MCU in a while(true)
loop if the error
method is called while flashing the LED and displaying a UART message. 1
- Display a UART message when the error
method is called but also forward the number to the cloud using LoRaWAN. Don't go in a while(true)
loop. void error | ( | uint8_t | number | ) |
Error method.
ERROR_FORWARDING == 0
The method flashes the LED, displays a UART message and holds the MCU forever in a loop until it gets reset. The error value gets stored in a global variable.
ERROR_FORWARDING == 1
The method sends the error value to the cloud using LoRaWAN if the error number doesn't correspond to LoRaWAN-related functionality (numbers 30 - 55).
[in] | number | The number to indicate where in the code the error was thrown. |
Definition at line 131 of file util.c.