|
IoT-MBBR (masterthesis)
Masterthesis upgrading a Moving Bed BioReactor with extra sensors and cloud connectivity.
|
Utility functionality. More...
#include <stdint.h>#include <stdbool.h>#include "em_cmu.h"#include "em_gpio.h"#include "util.h"#include "pin_mapping.h"#include "debug_dbprint.h"#include "delay.h"Go to the source code of this file.
Functions | |
| static void | initGNDd (void) |
| Initialize the initGNDd pin. More... | |
| void | gndd (bool enabled) |
| Enable or disable the GNDd pin. More... | |
| void | error (uint8_t number) |
| Error method. More... | |
Variables | |
| uint8_t | errorNumber = 0 |
| bool | GNDd_initialized = false |
Utility functionality.
GPIO_PinOutClear line in initLED. main.c to here, added delay functionality which goes into EM1 or EM2. Error() to error(), added a global variable to keep the error number and initialize the pin of the LED automatically. static before the local variables (not necessary). Copyright (C) 2020 - 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.c.
| 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 122 of file util.c.
| void gndd | ( | bool | enabled | ) |
|
static |
Initialize the initGNDd pin.
Definition at line 184 of file util.c.