/* Reflow Oven Controller * * Copyright (C) 2020 Mario Hüttel * * 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 . */ /** * @file main.c * @brief Main file for firmware */ #include #include /* #include */ #include #include #include #include #include #include #include #include #include #include #include static void setup_nvic_priorities() { /* No sub priorities */ NVIC_SetPriorityGrouping(2); /* Setup Priorities */ NVIC_SetPriority(ADC_IRQn, 2); NVIC_SetPriority(DMA2_Stream0_IRQn, 1); NVIC_SetPriority(DMA2_Stream7_IRQn, 3); } static float pt1000_value; static volatile int pt1000_value_status; static uint32_t rot; int main() { const char *uart_input; size_t uart_input_len; shellmatta_handle_t shell_handle; int uart_receive_status; setup_nvic_priorities(); systick_setup(); adc_pt1000_setup_meas(); digio_setup_default_all(); led_setup(); loudspeaker_setup(); rotary_encoder_setup(); uart_init_with_dma(); shell_handle = shell_init(); while(1) { pt1000_value_status = adc_pt1000_get_current_resistance(&pt1000_value); rot = rotary_encoder_get_abs_val(); uart_receive_status = uart_receive_data_with_dma(&uart_input, &uart_input_len); if (uart_receive_status >= 1) shell_handle_input(shell_handle, uart_input, uart_input_len); } }