Add structure for safety controller config.
This commit is contained in:
		
							
								
								
									
										51
									
								
								stm-firmware/safety/safety-controller-config-default.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								stm-firmware/safety/safety-controller-config-default.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
/* 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/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @defgroup safety-controller-config Safety Controller Setup
 | 
			
		||||
 * @ingroup safety-controller
 | 
			
		||||
 * @addtogroup safety-controller-config
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <reflow-controller/safety/safety-controller-config-default.h>
 | 
			
		||||
 | 
			
		||||
static const struct safety_controller_config default_conf = {
 | 
			
		||||
	.flag_cnt = N_ERR_FLAG,
 | 
			
		||||
	.flag_configs = {
 | 
			
		||||
		{.clear_by_sw = false, .persistent = false}, /* ERR_FLAG_MEAS_ADC_OFF */
 | 
			
		||||
		{.clear_by_sw = true, .persistent = true}, /* ERR_FLAG_MEAS_ADC_OVERFLOW */
 | 
			
		||||
		{.clear_by_sw = true, .persistent = true}, /* ERR_FLAG_MEAS_ADC_WATCHDOG */
 | 
			
		||||
		{.clear_by_sw = false, .persistent = false}, /* ERR_FLAG_MEAS_ADC_UNSTABLE */
 | 
			
		||||
	},
 | 
			
		||||
	.timing_mon_cnt = N_ERR_TIMING,
 | 
			
		||||
	.timing_configs = {
 | 
			
		||||
		{}, /* ERR_TIMING_PID */
 | 
			
		||||
		{}, /* ERR_TIMING_MEAS_ADC */
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const struct safety_controller_config *safety_controller_default_config_get()
 | 
			
		||||
{
 | 
			
		||||
	return &default_conf;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @} */
 | 
			
		||||
@@ -18,4 +18,15 @@
 | 
			
		||||
* If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @addtogroup safety-controller
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <reflow-controller/safety/safety-controller.h>
 | 
			
		||||
#include <reflow-controller/safety/safety-config.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @} */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								stm-firmware/safety/safety-controller.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								stm-firmware/safety/safety-controller.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
/**
 | 
			
		||||
@defgroup safety-controller Safety Controller
 | 
			
		||||
@ingroup safety
 | 
			
		||||
This is the main module for the safety part of the firmware. It monitors
 | 
			
		||||
analog values, error states and timeouts of timing critical sections of the firmware.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
		Reference in New Issue
	
	Block a user