5 Commits

Author SHA1 Message Date
8a365ab5e0 Move safety ADC to safety subfolder 2020-07-06 20:13:01 +02:00
7cd05e1582 Update shellmatta 2020-06-25 23:54:36 +02:00
0e97d57883 Improve menu function 2020-06-25 23:52:58 +02:00
cced874460 Add Pullup to uart RX pin 2020-06-21 01:29:50 +02:00
49927a25cf Add Omega as unit for Ohm in LCD menu 2020-06-16 20:05:32 +02:00
8 changed files with 22 additions and 9 deletions

View File

@@ -46,7 +46,8 @@ CFILES += ui/lcd.c ui/menu.c reflow-menu.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-adc.c
CFILES += safety/safety-adc.c
DEBUG_DEFINES = -DDEBUGBUILD DEBUG_DEFINES = -DDEBUGBUILD
RELEASE_DEFINES = RELEASE_DEFINES =

View File

@@ -39,6 +39,8 @@
#define LCD_SHIMATTA_STRING "\xBC\xCF\xAF\xC0" #define LCD_SHIMATTA_STRING "\xBC\xCF\xAF\xC0"
#define LCD_DEGREE_SYMBOL_STRING "\xDF" #define LCD_DEGREE_SYMBOL_STRING "\xDF"
#define LCD_DEGREE_SYMBOL_CHAR '\xDF' #define LCD_DEGREE_SYMBOL_CHAR '\xDF'
#define LCD_OHM_SYMBOL_CHAR '\xF4'
#define LCD_OHM_SYMBOL_STRING "\xF4"
enum lcd_fsm_ret {LCD_FSM_NOP, LCD_FSM_CALL_AGAIN, LCD_FSM_WAIT_CALL}; enum lcd_fsm_ret {LCD_FSM_NOP, LCD_FSM_CALL_AGAIN, LCD_FSM_WAIT_CALL};

View File

@@ -41,7 +41,7 @@
#include <stm-periph/uart.h> #include <stm-periph/uart.h>
#include <reflow-controller/shell-uart-config.h> #include <reflow-controller/shell-uart-config.h>
#include <reflow-controller/oven-driver.h> #include <reflow-controller/oven-driver.h>
#include <reflow-controller/safety-adc.h> #include <reflow-controller/safety/safety-adc.h>
#include <fatfs/ff.h> #include <fatfs/ff.h>
#include <reflow-controller/reflow-menu.h> #include <reflow-controller/reflow-menu.h>
@@ -74,6 +74,9 @@ static inline void uart_gpio_config(void)
SHELL_UART_PORT->MODER |= ALTFUNC(SHELL_UART_RX_PIN) | ALTFUNC(SHELL_UART_TX_PIN); SHELL_UART_PORT->MODER |= ALTFUNC(SHELL_UART_RX_PIN) | ALTFUNC(SHELL_UART_TX_PIN);
SETAF(SHELL_UART_PORT, SHELL_UART_RX_PIN, SHELL_UART_RX_PIN_ALTFUNC); SETAF(SHELL_UART_PORT, SHELL_UART_RX_PIN, SHELL_UART_RX_PIN_ALTFUNC);
SETAF(SHELL_UART_PORT, SHELL_UART_TX_PIN, SHELL_UART_TX_PIN_ALTFUNC); SETAF(SHELL_UART_PORT, SHELL_UART_TX_PIN, SHELL_UART_TX_PIN_ALTFUNC);
/* Setup Pullup resistor at UART RX */
SHELL_UART_PORT->PUPDR |= PULLUP(SHELL_UART_RX_PIN);
#endif #endif
} }
@@ -256,6 +259,8 @@ int main(void)
if (menu_wait_request) if (menu_wait_request)
__WFI(); __WFI();
else
__NOP();
} }

View File

@@ -24,7 +24,7 @@
#include <reflow-controller/rotary-encoder.h> #include <reflow-controller/rotary-encoder.h>
#include <reflow-controller/systick.h> #include <reflow-controller/systick.h>
#include <reflow-controller/adc-meas.h> #include <reflow-controller/adc-meas.h>
#include <reflow-controller/safety-adc.h> #include <reflow-controller/safety/safety-adc.h>
#include <reflow-controller/temp-converter.h> #include <reflow-controller/temp-converter.h>
#include <helper-macros/helper-macros.h> #include <helper-macros/helper-macros.h>
#include <stm-periph/unique-id.h> #include <stm-periph/unique-id.h>
@@ -71,7 +71,7 @@ static void reflow_menu_monitor(struct lcd_menu *menu, enum menu_entry_func_entr
if (systick_ticks_have_passed(my_timestamp, 250)) { if (systick_ticks_have_passed(my_timestamp, 250)) {
my_timestamp = systick_get_global_tick(); my_timestamp = systick_get_global_tick();
adc_pt1000_get_current_resistance(&tmp); adc_pt1000_get_current_resistance(&tmp);
snprintf(line, sizeof(line), "Res: %.1f", tmp); snprintf(line, sizeof(line), "Res: %.1f " LCD_OHM_SYMBOL_STRING, tmp);
menu->update_display(0, line); menu->update_display(0, line);
res = temp_converter_convert_resistance_to_temp(tmp, &tmp); res = temp_converter_convert_resistance_to_temp(tmp, &tmp);
@@ -206,6 +206,7 @@ static void reflow_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_e
(void)parent; (void)parent;
static struct menu_list list; static struct menu_list list;
static bool button_valid; static bool button_valid;
static bool menu_changed = true;
static const char * const root_entry_names[] = { static const char * const root_entry_names[] = {
"About", "About",
"Monitoring", "Monitoring",
@@ -219,6 +220,7 @@ static void reflow_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_e
int16_t rot_delta; int16_t rot_delta;
if (entry_type != MENU_ENTRY_CONTINUE) { if (entry_type != MENU_ENTRY_CONTINUE) {
menu_changed = true;
menu_display_clear(menu); menu_display_clear(menu);
update_display_buffer(0, "Main Menu"); update_display_buffer(0, "Main Menu");
menu_ack_rotary_delta(menu); menu_ack_rotary_delta(menu);
@@ -245,11 +247,14 @@ static void reflow_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_e
if (rot_delta >= 4) { if (rot_delta >= 4) {
menu_list_scroll_down(&list); menu_list_scroll_down(&list);
menu_ack_rotary_delta(menu); menu_ack_rotary_delta(menu);
menu_changed = true;
} else if (rot_delta <= -4) { } else if (rot_delta <= -4) {
menu_list_scroll_up(&list); menu_list_scroll_up(&list);
menu_ack_rotary_delta(menu); menu_ack_rotary_delta(menu);
menu_changed = true;
} }
if (menu_changed)
menu_list_display(&list, 1, 3); menu_list_display(&list, 1, 3);
} }

View File

@@ -18,7 +18,7 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <reflow-controller/safety-adc.h> #include <reflow-controller/safety/safety-adc.h>
#include <reflow-controller/periph-config/safety-adc-hwcfg.h> #include <reflow-controller/periph-config/safety-adc-hwcfg.h>
#include <helper-macros/helper-macros.h> #include <helper-macros/helper-macros.h>
#include <stm-periph/clock-enable-manager.h> #include <stm-periph/clock-enable-manager.h>

View File

@@ -35,7 +35,7 @@
#include <fatfs/ff.h> #include <fatfs/ff.h>
#include <reflow-controller/stack-check.h> #include <reflow-controller/stack-check.h>
#include <reflow-controller/rotary-encoder.h> #include <reflow-controller/rotary-encoder.h>
#include <reflow-controller/safety-adc.h> #include <reflow-controller/safety/safety-adc.h>
#ifndef GIT_VER #ifndef GIT_VER
#define GIT_VER "VERSION NOT SET" #define GIT_VER "VERSION NOT SET"