Moved headers to /include, removed leftovers from migration from Sloeber to PlatformIO

This commit is contained in:
2024-06-25 21:41:16 +01:00
parent 38375ea750
commit bc86025260
15 changed files with 0 additions and 314 deletions

View File

@@ -1,39 +0,0 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

41
include/config.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <Arduino.h>
#include <Keypad.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <AccelStepper.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// Constants and definitions
#define LCD_COLUMNS 20
#define LCD_ROWS 4
#define PULSE_PIN 12
#define DIR_PIN 14
#define EN_PIN 27
#define STEPS_PER_REV 4800
#define RPM 60
#define SPEED (RPM * STEPS_PER_REV / 60.0)
#define TEMP_SENSOR_PIN 13
#define NUM_DEV_SEQUENCES 6
extern const char *version;
extern Keypad keypad;
extern LiquidCrystal_I2C lcd;
extern AccelStepper stepper;
extern OneWire oneWire;
extern DallasTemperature sensors;
extern String devPgm;
extern int run;
extern const int beeperPin;
extern byte thermometer[8];
extern TaskHandle_t motorTaskHandle;
extern TaskHandle_t tempTaskHandle;
extern unsigned long processStartTime;
extern unsigned long processTimeMillis;
#endif

20
include/devSequence.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef DEVSEQUENCE_H
#define DEVSEQUENCE_H
#define NUM_DEV_SEQUENCES 6
#include <Arduino.h>
struct devSequence
{
char processName[7];
int cycles;
unsigned long int processTime[20];
char processCycleName[20][10];
float processCycle[2][20];
float processTemp[3][20];
};
extern struct devSequence devSequences[NUM_DEV_SEQUENCES];
struct devSequence *findSequenceByName(const char *processName);
#endif

13
include/display.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef DISPLAY_H
#define DISPLAY_H
#include <LiquidCrystal_I2C.h>
#include "config.h"
void updateTempDisplay(void *parameter);
void startingMenu();
void processHeadings();
void readTemperature();
char *secondsToMinutesSeconds(int seconds);
#endif

16
include/menu.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef MENU_H
#define MENU_H
#include "config.h"
#include "devSequence.h"
#include "motor.h"
#include "display.h"
#include "sound.h"
void getMenuInput();
char getScrollEntEscInput();
char getEntEscInput();
int startProcessing(struct devSequence *sequence, int sequenceStep);
void startDev();
#endif

16
include/motor.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef MOTOR_H
#define MOTOR_H
#include <AccelStepper.h>
#include "config.h"
struct MotorTaskParams
{
float cwRotations;
float ccwRotations;
unsigned long int processEndTime;
};
void runMotorTask(void *parameter);
#endif

9
include/sound.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef SOUND_H
#define SOUND_H
#include "config.h"
void playTune();
void playAlarmTone();
#endif

10
include/temperature.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef TEMPERATURE_H
#define TEMPERATURE_H
#include "config.h"
void readTemperature();
void updateTempDisplay();
#endif

18
include/watchdog.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef WATCHDOG_H
#define WATCHDOG_H
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_task_wdt.h"
// Disable the watchdog timers
void disableWatchdogTimers()
{
esp_task_wdt_deinit();
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0);
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCPU(1);
esp_task_wdt_delete(idle_0);
esp_task_wdt_delete(idle_1);
}
#endif