Compare commits
No commits in common. "cc6e922d1bf375eb51fc2e6d5b23a2cc6e024ab0" and "627da0def5e74d3fd6939a2d1e7d4d3eb3e02aeb" have entirely different histories.
cc6e922d1b
...
627da0def5
@ -35,7 +35,7 @@ DEFINES += -DSHELLMATTA_HELP_ALIAS=\"?\"
|
|||||||
|
|
||||||
# RCC Manager
|
# RCC Manager
|
||||||
CFILES += stm-periph/clock-enable-manager.c
|
CFILES += stm-periph/clock-enable-manager.c
|
||||||
CFILES += stm-periph/uart.c stm-periph/dma-ring-buffer.c stm-periph/backup-ram.c
|
CFILES += stm-periph/uart.c stm-periph/dma-ring-buffer.c
|
||||||
CFILES += digio.c
|
CFILES += digio.c
|
||||||
CFILES += stm-periph/unique-id.c
|
CFILES += stm-periph/unique-id.c
|
||||||
CFILES += calibration.c
|
CFILES += calibration.c
|
||||||
@ -43,11 +43,12 @@ CFILES += temp-converter.c
|
|||||||
CFILES += rotary-encoder.c button.c
|
CFILES += rotary-encoder.c button.c
|
||||||
CFILES += stack-check.c
|
CFILES += stack-check.c
|
||||||
CFILES += ui/lcd.c ui/menu.c reflow-menu.c
|
CFILES += ui/lcd.c ui/menu.c reflow-menu.c
|
||||||
|
#CFILES += onewire-temp-sensors.c
|
||||||
CFILES += fatfs/diskio.c fatfs/ff.c fatfs/ffsystem.c fatfs/ffunicode.c fatfs/shimatta_sdio_driver/shimatta_sdio.c
|
CFILES += fatfs/diskio.c fatfs/ff.c fatfs/ffsystem.c fatfs/ffunicode.c fatfs/shimatta_sdio_driver/shimatta_sdio.c
|
||||||
CFILES += pid-controller.c oven-driver.c
|
CFILES += pid-controller.c oven-driver.c
|
||||||
CFILES += settings/settings.c settings/settings-sd-card.c
|
CFILES += settings/settings.c settings/settings-sd-card.c
|
||||||
|
|
||||||
CFILES += safety/safety-adc.c safety/safety-controller.c safety/watchdog.c safety/fault.c
|
CFILES += safety/safety-adc.c safety/safety-controller.c safety/watchdog.c
|
||||||
|
|
||||||
DEBUG_DEFINES = -DDEBUGBUILD
|
DEBUG_DEFINES = -DDEBUGBUILD
|
||||||
RELEASE_DEFINES =
|
RELEASE_DEFINES =
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
/* Reflow Oven Controller
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
|
||||||
*
|
|
||||||
* This file is part of the Reflow Oven Controller Project.
|
|
||||||
*
|
|
||||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* The Reflow Oven Control Firmware 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.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with the reflow oven controller project.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This function implements the panic mode
|
|
||||||
*
|
|
||||||
* This function will never return and ensures that the controller goes in a safe operating state
|
|
||||||
* The watchdog will eventually reset the controller from this state. Therefore, this function sets
|
|
||||||
* a flag in the backup SRAM that will prevent the controller from booting in normal operation.
|
|
||||||
*/
|
|
||||||
void panic_mode(void);
|
|
@ -1,51 +0,0 @@
|
|||||||
/* Reflow Oven Controller
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
|
||||||
*
|
|
||||||
* This file is part of the Reflow Oven Controller Project.
|
|
||||||
*
|
|
||||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* The Reflow Oven Control Firmware 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.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with the reflow oven controller project.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Init the backup ram and make it accesible
|
|
||||||
*/
|
|
||||||
void backup_ram_init();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Disable access to the backup RAM. This saves power
|
|
||||||
*/
|
|
||||||
void backup_ram_disable();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Whis function overwrites the backup RAM with 0x00
|
|
||||||
*/
|
|
||||||
void backup_ram_wipe();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Read data from the backup RAM
|
|
||||||
* @param addr Address offset inside memory
|
|
||||||
* @param data read 32bit data
|
|
||||||
*/
|
|
||||||
int backup_ram_get_data(uint32_t addr, uint32_t *data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Write data structure to backup RAM
|
|
||||||
* @param data
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int backup_ram_write_data(uint32_t addr, uint32_t data);
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
/* #include <arm_math.h> */
|
||||||
#include <stm32/stm32f4xx.h>
|
#include <stm32/stm32f4xx.h>
|
||||||
#include <cmsis/core_cm4.h>
|
#include <cmsis/core_cm4.h>
|
||||||
#include <setup/system_stm32f4xx.h>
|
#include <setup/system_stm32f4xx.h>
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
/* Reflow Oven Controller
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
|
||||||
*
|
|
||||||
* This file is part of the Reflow Oven Controller Project.
|
|
||||||
*
|
|
||||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* The Reflow Oven Control Firmware 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.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with the reflow oven controller project.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <reflow-controller/oven-driver.h>
|
|
||||||
#include <reflow-controller/digio.h>
|
|
||||||
#include <reflow-controller/safety/fault.h>
|
|
||||||
|
|
||||||
void HardFault_Handler(void)
|
|
||||||
{
|
|
||||||
/* This is a non recoverable fault. Hang here */
|
|
||||||
|
|
||||||
oven_driver_set_power(0);
|
|
||||||
oven_driver_apply_power_level();
|
|
||||||
|
|
||||||
led_set(0, 1);
|
|
||||||
|
|
||||||
while (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void panic_mode(void)
|
|
||||||
{
|
|
||||||
/* Panic mode is esentially the same as a hardfault,
|
|
||||||
* but it can be expected, that more functionality is still usable
|
|
||||||
*/
|
|
||||||
|
|
||||||
oven_driver_set_power(0);
|
|
||||||
oven_driver_apply_power_level();
|
|
||||||
|
|
||||||
/* TODO: implement panic mode */
|
|
||||||
|
|
||||||
while (1);
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
/* Reflow Oven Controller
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
|
||||||
*
|
|
||||||
* This file is part of the Reflow Oven Controller Project.
|
|
||||||
*
|
|
||||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* The Reflow Oven Control Firmware 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.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with the reflow oven controller project.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stm-periph/backup-ram.h>
|
|
||||||
#include <stm-periph/clock-enable-manager.h>
|
|
||||||
#include <stm32/stm32f4xx.h>
|
|
||||||
|
|
||||||
void backup_ram_init()
|
|
||||||
{
|
|
||||||
rcc_manager_enable_clock(&RCC->APB1ENR, BITMASK_TO_BITNO(RCC_APB1ENR_PWREN));
|
|
||||||
|
|
||||||
/* Enable access to backup RAM register set */
|
|
||||||
PWR->CR |= PWR_CR_DBP;
|
|
||||||
|
|
||||||
/* Enable clock for backup ram interface */
|
|
||||||
rcc_manager_enable_clock(&RCC->AHB1ENR, BITMASK_TO_BITNO(RCC_AHB1ENR_BKPSRAMEN));
|
|
||||||
}
|
|
||||||
|
|
||||||
void backup_ram_disable()
|
|
||||||
{
|
|
||||||
rcc_manager_disable_clock(&RCC->APB1ENR, BITMASK_TO_BITNO(RCC_APB1ENR_PWREN));
|
|
||||||
}
|
|
||||||
|
|
||||||
void backup_ram_wipe()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int backup_ram_get_data(uint32_t addr, uint32_t *data)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int backup_ram_write_data(uint32_t addr, uint32_t data)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -112,7 +112,7 @@ bool __attribute__((optimize("O3"))) systick_ticks_have_passed(uint64_t start_ti
|
|||||||
*/
|
*/
|
||||||
void __attribute__((optimize("O3"))) SysTick_Handler()
|
void __attribute__((optimize("O3"))) SysTick_Handler()
|
||||||
{
|
{
|
||||||
static uint32_t IN_SECTION(.ccm.bss) pre_tick = 0UL;
|
static uint32_t pre_tick = 0UL;
|
||||||
|
|
||||||
pre_tick++;
|
pre_tick++;
|
||||||
if (pre_tick == 10) {
|
if (pre_tick == 10) {
|
||||||
@ -121,6 +121,5 @@ void __attribute__((optimize("O3"))) SysTick_Handler()
|
|||||||
wait_tick_ms++;
|
wait_tick_ms++;
|
||||||
global_tick_ms++;
|
global_tick_ms++;
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_tick_100us++;
|
lcd_tick_100us++;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include <reflow-controller/systick.h>
|
#include <reflow-controller/systick.h>
|
||||||
#include <stm-periph/clock-enable-manager.h>
|
#include <stm-periph/clock-enable-manager.h>
|
||||||
#include <stm-periph/stm32-gpio-macros.h>
|
#include <stm-periph/stm32-gpio-macros.h>
|
||||||
#include <helper-macros/helper-macros.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -150,7 +149,7 @@ static void lcd_command(uint8_t data)
|
|||||||
// Set DD RAM Address --------- 0b1xxxxxxx (Display Data RAM)
|
// Set DD RAM Address --------- 0b1xxxxxxx (Display Data RAM)
|
||||||
#define LCD_SET_DDADR 0x80
|
#define LCD_SET_DDADR 0x80
|
||||||
|
|
||||||
static char IN_SECTION(.ccm.bss) shadow_display[4][21];
|
static char __attribute__((section(".ccm.bss"))) shadow_display[4][21];
|
||||||
|
|
||||||
void lcd_clear(void)
|
void lcd_clear(void)
|
||||||
{
|
{
|
||||||
@ -348,13 +347,13 @@ static void lcd_fsm_write_data(bool high, uint8_t data)
|
|||||||
|
|
||||||
enum lcd_fsm_ret lcd_fsm_write_buffer(const char (*display_buffer)[21])
|
enum lcd_fsm_ret lcd_fsm_write_buffer(const char (*display_buffer)[21])
|
||||||
{
|
{
|
||||||
static bool IN_SECTION(.ccm.data) idle = true;
|
static bool idle = true;
|
||||||
static uint8_t IN_SECTION(.ccm.bss) rows_to_handle = 0;
|
static uint8_t rows_to_handle = 0;
|
||||||
static uint32_t IN_SECTION(.ccm.bss) state_cnt;
|
static uint32_t state_cnt;
|
||||||
static uint8_t IN_SECTION(.ccm.bss) row_cnt = 0;
|
static uint8_t row_cnt = 0;
|
||||||
static uint32_t IN_SECTION(.ccm.bss) char_cnt;
|
static uint32_t char_cnt;
|
||||||
static uint32_t IN_SECTION(.ccm.bss) line_len;
|
static uint32_t line_len;
|
||||||
static uint64_t IN_SECTION(.ccm.bss) timestamp = 0ULL;
|
static uint64_t timestamp = 0ULL;
|
||||||
enum lcd_fsm_ret ret;
|
enum lcd_fsm_ret ret;
|
||||||
|
|
||||||
ret = LCD_FSM_NOP;
|
ret = LCD_FSM_NOP;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user