Embedded-Software-Projects

Log | Files | Refs | README | LICENSE

commit c65f07dc65edee99eff8cae651ff15e554f50d44
parent 54edcadbdb33757f59feb056026c99ef4e6b4c6d
Author: William Lindholm <william_lindholm@outlook.com>
Date:   Wed, 23 Oct 2024 23:00:59 +0100

Improved formatting

Diffstat:
MProject1/.vs/Project1/v14/.atsuo | 0
MProject1/Project1/main.c | 15+++++++--------
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Project1/.vs/Project1/v14/.atsuo b/Project1/.vs/Project1/v14/.atsuo Binary files differ. diff --git a/Project1/Project1/main.c b/Project1/Project1/main.c @@ -11,25 +11,23 @@ #include <avr/cpufunc.h> #include <stdbool.h> - -/************************************************************************/ -/* Precalculated Time & Voltage values */ -/************************************************************************/ +// Precalculated voltage and time values #define THREE_VOLT 614 // 3*1023 /5 = ~613 #define EIGHT_S 2441 // 20Mhz => 0.05 uS, 0.05 * 1024 = 51.2 uS, 0.125 S = 125 000 uS, 125 000 / 51.2 ~2441 counts #define HALF_S 9766 // 20Mhz => 0.05 uS, 0.05 * 1024 = 51.2 uS, 0.5 S = 500 000 uS, 500 000 / 51.2 ~9766 counts -#define SPLIT_LED 4 // When in split mode, split on led 4 +// decide on which led the cylon and thermometer are split +#define SPLIT_LED 4 // only used when in split mode /************************************************************************/ -/* Global program modes */ +/* Global variables */ /************************************************************************/ enum MODES { VOLTAGE, // Show voltage reading (full display; 10 LED:s) CYLON, // Show Cylon animation (full display; 10 LED:s) - SPLIT // Show Cylon animation (half display, 5 LED:s) & voltage reading (half display, 5 LED:s) + SPLIT // Show Cylon animation and voltage reading (split based on SPLIT_LED) }; enum MODES DISPLAY_MODE = CYLON; @@ -39,7 +37,7 @@ uint16_t ADC_VALUE; /************************************************************************/ -/* LED PORT definitions */ +/* LED PORT definitions */ /************************************************************************/ struct LED_BITS { @@ -55,6 +53,7 @@ struct LED_BITS LED_Array[10] = { // Precalculated values for non-split display are stored in precalculated_thresholds[1][0-9] uint16_t precalculated_thresholds[2][sizeof(LED_Array) / sizeof(LED_Array[0]) - 1]; + /************************************************************************/ /* Function declarations */ /************************************************************************/