Consolidate unfinished tasks and update documentation
This commit is contained in:
26
docs/LICENSE.md
Normal file
26
docs/LICENSE.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
## License
|
||||||
|
|
||||||
|
All Rights Reserved
|
||||||
|
|
||||||
|
Copyright (c) 2024 Madcow Software
|
||||||
|
Copyright (c) 2024 Carlos Krieg
|
||||||
|
|
||||||
|
THE CONTENTS OF THIS PROJECT ARE PROPRIETARY AND CONFIDENTIAL.
|
||||||
|
UNAUTHORIZED COPYING, TRANSFERRING OR REPRODUCTION OF THE
|
||||||
|
CONTENTS OF THIS PROJECT, VIA ANY MEDIUM IS STRICTLY PROHIBITED.
|
||||||
|
|
||||||
|
The receipt or possession of the source code and/or any parts
|
||||||
|
thereof does not convey or imply any right to use them for any
|
||||||
|
purpose other than the purpose for which they were provided to you.
|
||||||
|
|
||||||
|
The software is provided "AS IS", without warranty of any kind,
|
||||||
|
express or implied, including but not limited to the warranties of
|
||||||
|
merchantability, fitness for a particular purpose and non
|
||||||
|
infringement. In no event shall the authors or copyright holders
|
||||||
|
be liable for any claim, damages or other liability, whether in an
|
||||||
|
action of contract, tort or otherwise, arising from, out of or in
|
||||||
|
connection with the software or the use or other dealings in the
|
||||||
|
software.
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the software.
|
||||||
@@ -31,24 +31,24 @@ Makefile for all build settings and make sure they are
|
|||||||
correct for your current environment.
|
correct for your current environment.
|
||||||
|
|
||||||
To remove build-related auxiliary files you may use one
|
To remove build-related auxiliary files you may use one
|
||||||
of these commands:
|
of these commands, with varying levels of cleanliness:
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
make distclean
|
make distclean
|
||||||
|
|
||||||
Isolated unit tests allow you to verify all testable
|
Isolated unit tests allow you to verify all source modules
|
||||||
components are behaving as expected. Please note that most
|
are behaving as expected. Please note that most tests will
|
||||||
tests will be added later down the road, when the project
|
be added later down the road, when the project has reached
|
||||||
has reached a more mature state. There is also support for
|
a more mature state. There is also support for running the
|
||||||
testing on simulated hardware if you have
|
binaries on simulated hardware if you have
|
||||||
[simavr](https://github.com/buserror/simavr) installed.
|
[simavr](https://github.com/buserror/simavr) installed.
|
||||||
|
|
||||||
make check
|
make check
|
||||||
make simulate
|
make simulate
|
||||||
|
|
||||||
You can listen on the serial debug interface by running
|
You can listen on the serial debug interface by executing
|
||||||
the command below. This will also initialize all optional
|
the command below. Optional submodules will be initialized
|
||||||
submodules on first invocation.
|
on first invocation since they contain the necessary tools.
|
||||||
|
|
||||||
make listen
|
make listen
|
||||||
|
|
||||||
|
|||||||
23
docs/TODO.md
Normal file
23
docs/TODO.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
## Current Tasks
|
||||||
|
|
||||||
|
- Test stability with 18.432 MHz external oscillator.
|
||||||
|
- Implement state machine for actual drying operation.
|
||||||
|
- Rewrite code documentation with proper structure.
|
||||||
|
- Check sensor measurements, conversion results and timer output frequencies.
|
||||||
|
- Implement custom bootloader to facilitate software updates over serial port.
|
||||||
|
- Make sure the initialization sequence can recover from as many technical
|
||||||
|
problems as possible.
|
||||||
|
- Implement I2C timeout or failing components may cause watchdog reset loop.
|
||||||
|
- Detect brown-out and external resets during the initialization sequence.
|
||||||
|
- Write isolated unit tests either with mocks or running in simulation.
|
||||||
|
- Write simulated I2C components for more realistic testing with simavr.
|
||||||
|
- MOSFET module needlessly specific? Rewrite as generic digital output?
|
||||||
|
- Handle more parser commands like UPDATE, START and STOP.
|
||||||
|
- Implement parser timeout for large input. Otherwise an UART RX buffer overflow
|
||||||
|
will swallow the line terminator leading to the next command not getting parsed
|
||||||
|
correctly. Also check for possible edge cases when the UART and parser buffers
|
||||||
|
have different sizes.
|
||||||
|
- Force system reset in Error() function?
|
||||||
|
- Test efficiency for I2C via interrupts and ADS1115 continous mode.
|
||||||
|
- Write cross-platform configuration header for different microchips?
|
||||||
|
- Refactoring and optimization after all v1.0 features are finalized.
|
||||||
@@ -14,12 +14,6 @@
|
|||||||
#define TW_MR_SLA_NACK 0x48 // SLA+R transmitted, NACK received
|
#define TW_MR_SLA_NACK 0x48 // SLA+R transmitted, NACK received
|
||||||
#define TW_MR_DATA_ACK 0x50 // Data received, ACK returned
|
#define TW_MR_DATA_ACK 0x50 // Data received, ACK returned
|
||||||
|
|
||||||
// TODO: Error handling and recovery besides watchdog timer.
|
|
||||||
// TODO: Add more documentation from the atmel data sheet.
|
|
||||||
// TODO: ADS1115 continuous mode instead of single-shot?
|
|
||||||
// TODO: Implement TWI_vect ISR? This may not actually be
|
|
||||||
// much better than the blocking approach.
|
|
||||||
|
|
||||||
static void I2C_AHT20_Reset(void);
|
static void I2C_AHT20_Reset(void);
|
||||||
static bool I2C_AHT20_IsCalibrated(void);
|
static bool I2C_AHT20_IsCalibrated(void);
|
||||||
static void I2C_AHT20_Calibrate(void);
|
static void I2C_AHT20_Calibrate(void);
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "bus/pwm.h"
|
#include "bus/pwm.h"
|
||||||
|
|
||||||
// TODO: Add documentation for timer3: TCCR3A, TCCR3B, etc.
|
|
||||||
|
|
||||||
int PWM_Init(void)
|
int PWM_Init(void)
|
||||||
{
|
{
|
||||||
// PD4: PWM NF-12 Fan Peltier Hot Side
|
// PD4: PWM NF-12 Fan Peltier Hot Side
|
||||||
@@ -102,7 +100,6 @@ void PWM_SetValue(int port, int value)
|
|||||||
if (port != FAN01 && port != FAN02 && port != FAN03)
|
if (port != FAN01 && port != FAN02 && port != FAN03)
|
||||||
return; // Invalid port
|
return; // Invalid port
|
||||||
|
|
||||||
// Workaround: Missing third 16-bit timer output
|
|
||||||
n = CLAMP(value, 100, 0) * PWM_CYCLE_TOP / 100.0f;
|
n = CLAMP(value, 100, 0) * PWM_CYCLE_TOP / 100.0f;
|
||||||
|
|
||||||
Info("Setting duty cycle for %s to %d/%d...",
|
Info("Setting duty cycle for %s to %d/%d...",
|
||||||
|
|||||||
@@ -6,11 +6,6 @@
|
|||||||
|
|
||||||
#define CMD_MAX_LEN 128
|
#define CMD_MAX_LEN 128
|
||||||
|
|
||||||
// TODO: Write documentation.
|
|
||||||
// TODO: Reset command buffer on timeout.
|
|
||||||
// TODO: Test with different RXBUF sizes.
|
|
||||||
// TODO: Add commands update, start and stop.
|
|
||||||
|
|
||||||
static char cmdbuf[CMD_MAX_LEN + 1];
|
static char cmdbuf[CMD_MAX_LEN + 1];
|
||||||
static char *tail = cmdbuf + CMD_MAX_LEN;
|
static char *tail = cmdbuf + CMD_MAX_LEN;
|
||||||
static char *head = cmdbuf;
|
static char *head = cmdbuf;
|
||||||
|
|||||||
11
src/main.c
11
src/main.c
@@ -6,17 +6,6 @@
|
|||||||
|
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
// TODO: Facilitate software updates over serial port.
|
|
||||||
// TODO: Check parser and circular buffer for edge cases.
|
|
||||||
// TODO: Implement command parser timeout for large input.
|
|
||||||
// TODO: Config header for chip specifics like EEPROM size.
|
|
||||||
// TODO: Check thermistor conversion results /w thermometer.
|
|
||||||
// TODO: Implement primary state machine for update loop.
|
|
||||||
// TODO: Use 18.432MHz quarz crystal, burn required fuses.
|
|
||||||
// TODO: Implement optional CRC8 sensor measurement check.
|
|
||||||
// TODO: Proper error handling and recovery (after testing).
|
|
||||||
// TODO: Check why the MCUCSR EXTRF reset flag is set.
|
|
||||||
|
|
||||||
enum state_e
|
enum state_e
|
||||||
{
|
{
|
||||||
S_IDLE,
|
S_IDLE,
|
||||||
|
|||||||
Reference in New Issue
Block a user