diff --git a/.cproject.bak b/.cproject.bak
deleted file mode 100644
index c1b3a84..0000000
--- a/.cproject.bak
+++ /dev/null
@@ -1,194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.project b/.project
deleted file mode 100644
index 817c755..0000000
--- a/.project
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- PeltierControllerV3
-
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- com.st.stm32cube.ide.mcu.MCUProjectNature
- com.st.stm32cube.ide.mcu.MCUCubeProjectNature
- org.eclipse.cdt.core.cnature
- com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature
- com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature
- com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature
- com.st.stm32cube.ide.mcu.MCURootProjectNature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 5d6d12c..516eec6 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -13,6 +13,20 @@
"configFiles": [
"openocd.cfg"
]
+ },
+ {
+ "showDevDebugOutput": "parsed",
+ "cwd": "${workspaceRoot}",
+ "executable": "./build/PeltierControllerV3.elf",
+ "name": "Attach STM32",
+ "request": "attach",
+ "type": "cortex-debug",
+ "servertype": "openocd",
+ "preLaunchTask": "Build STM",
+ "device": "stm32l432",
+ "configFiles": [
+ "openocd.cfg"
+ ]
}
]
}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 91a08dd..6228ea8 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,8 +1,10 @@
{
"C_Cpp.errorSquiggles": "Disabled",
"files.associations": {
- "peco_peltiercontroller.h": "c"
- },
+ "peco_peltiercontroller.h": "c",
+ "cmsis_os2.h": "c",
+ "varh_variablehandler.h": "c"
+},
"cortex-debug.armToolchainPath": "c:\\Users\\pique_n\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\arm-none-eabi-gcc\\10.3.1-2.3.1\\.content\\bin",
"cortex-debug.openocdPath": "C:\\USERS\\PIQUE_N\\APPDATA\\ROAMING\\CODE\\USER\\GLOBALSTORAGE\\BMD.STM32-FOR-VSCODE\\@XPACK-DEV-TOOLS\\OPENOCD\\0.11.0-2.1\\.CONTENT\\BIN\\OPENOCD.EXE",
"cortex-debug.variableUseNaturalFormat": true
diff --git a/Core/Application/INIT_Initialization.c b/Core/Application/INIT_Initialization.c
index 26fca3b..bda9096 100644
--- a/Core/Application/INIT_Initialization.c
+++ b/Core/Application/INIT_Initialization.c
@@ -31,7 +31,6 @@
//=================================================================================================
#include "../SDEF_StandardDefinitions.h"
-#include "../PDEF_ProjectDefinitions.h"
#include "INIT_Initialization.h"
// Application
@@ -161,23 +160,20 @@ PRIVATE VOID vTask( PVOID arg )
//boOK &= USFL_boInitializeModule();
boOK &= VARH_boInitializeModule();
- boOK &= DIPO_boInitializeModule();
-
+ boOK &= DIPO_boInitializeModule();
boOK &= ANPI_boInitializeModule();
boOK &= ANPO_boInitializeModule();
boOK &= SPID_boInitializeModule();
-
boOK &= ADCD_boInitializeModule();
boOK &= TEMP_boInitializeModule();
- boOK &= PECO_boInitializeModule();
boOK &= CAND_boInitializeModule();
-
+ boOK &= PECO_boInitializeModule();
boOK &= MAIN_boInitializeModule();
if( !boOK ){
osKernelLock(); // lock kernel to prevent task switch
- while( 1 ){
+ while( 1 ){ // Toggle Error LED fast
DIPO_vToggleOutput( DIPO_eLED );
DELAY_MS( 100 );
}
diff --git a/Core/Application/MAIN_MainApplication.c b/Core/Application/MAIN_MainApplication.c
index 84073eb..518711e 100644
--- a/Core/Application/MAIN_MainApplication.c
+++ b/Core/Application/MAIN_MainApplication.c
@@ -30,17 +30,16 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "MAIN_MainApplication.h"
// Application
#include "VARH_VariableHandler.h"
+#include "PECO_PeltierController.h"
// Drivers
#include "../Drivers/TEMP_Temperature.h"
#include "../Drivers/DIPO_DigitalPorts.h"
#include "../Drivers/CAND_CanDriver.h"
-#include "PECO_PeltierController.h"
#include "../Drivers/ANPI_AnalogPortsIn.h"
// Toolbox
@@ -126,12 +125,11 @@ LOCAL CONST osThreadAttr_t stTaskAttribute =
0, // size of provided memory for control block
NULL, // memory for stack
1024, // size of stack
- osPriorityNormal, // initial thread priority (default: osPriorityNormal)
+ osPriorityAboveNormal1, // initial thread priority (default: osPriorityNormal)
0, // TrustZone module identifier
0, // reserved (must be 0)
};
-
LOCAL CONST osMessageQueueAttr_t stCANRxMsgQueueAttribute =
{
"MAIN_CAN_Rx_Queue", // name of the message queue
@@ -142,8 +140,6 @@ LOCAL CONST osMessageQueueAttr_t stCANRxMsgQueueAttribute =
0, // size of provided memory for data storage
};
-
-
LOCAL CONST osEventFlagsAttr_t stEventAttribute =
{
"MAIN_Event_Flags", // name of the event flags
@@ -232,34 +228,35 @@ PRIVATE VOID vTask( PVOID arg )
while( TRUE )
{
- u32Flags = osEventFlagsWait( m_pstEventID, EVENT_FLAGS_ALL, osFlagsWaitAny, osWaitForever );
+ u32Flags = osEventFlagsWait( m_pstEventID, EVENT_FLAGS_ALL, osFlagsWaitAny, osWaitForever ); // wait until flags getting triggered
- if( u32Flags & EVENT_NEW_MESSAGE ) {
+ if( u32Flags & EVENT_NEW_MESSAGE ) { // New message from CAN
CAND_Message stMessage;
- osMessageQueueGet( m_pstCANRxMsgQueueID, &stMessage, NULL, 0 );
+ osMessageQueueGet( m_pstCANRxMsgQueueID, &stMessage, NULL, 0 ); // get message from queue
U8 u8Register = stMessage.au8Data[0];
U8 u8Type = stMessage.u8Type;
- if( u8Type == MESSAGE_TYPE_READ ){
- if( u8Register >= VARH_eNumberOfVariables ){
- au8Buffer[0] = 0xFF;
+ if( u8Type == MESSAGE_TYPE_READ ){ // Message type read
+ if( u8Register >= VARH_eNumberOfVariables ){ // check register
+ // send register not found
+ au8Buffer[0] = 0xFF;
CAND_boSendMessage( au8Buffer, 1 );
} else {
- VARH_UVariable uVariable = VARH_uGetVariableData(u8Register);
+ VARH_UVariable uVariable = VARH_uGetVariableData(u8Register); // get data
au8Buffer[0] = u8Register;
- UTIL_vMemCopy(&uVariable, &au8Buffer[1], 4);
+ UTIL_vMemCopy(&uVariable, &au8Buffer[1], 4); // copy data in buffer
CAND_boSendMessage( au8Buffer, 5 );
}
- } else if( u8Type == MESSAGE_TYPE_WRITE ){
+ } else if( u8Type == MESSAGE_TYPE_WRITE ){ // Message type write
VARH_UVariable uData;
UTIL_vMemCopy(&stMessage.au8Data[1], &uData, 4);
VARH_vSetVariableData(u8Register, uData);
- } else if( u8Type == MESSAGE_TYPE_COMMAND ){
+ } else if( u8Type == MESSAGE_TYPE_COMMAND ){ // Message type command
switch (u8Register)
{
@@ -271,7 +268,7 @@ PRIVATE VOID vTask( PVOID arg )
PECO_Enable( FALSE );
break;
case COMMAND_WATCHDOG:
- osTimerStart( m_pstWatchdogTimer, WATCHDOG )
+ osTimerStart( m_pstWatchdogTimer, WATCHDOG );
break;
default:
break;
diff --git a/Core/Application/PECO_PeltierController.c b/Core/Application/PECO_PeltierController.c
index d6d455a..dbad36f 100644
--- a/Core/Application/PECO_PeltierController.c
+++ b/Core/Application/PECO_PeltierController.c
@@ -30,7 +30,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "PECO_PeltierController.h"
//Application
diff --git a/Core/Application/PECO_PeltierController.h b/Core/Application/PECO_PeltierController.h
index 6a2927e..55b9201 100644
--- a/Core/Application/PECO_PeltierController.h
+++ b/Core/Application/PECO_PeltierController.h
@@ -7,7 +7,7 @@
//-------------------------------------------------------------------------------------------------
//
// Project: Peltier Controller V2
-// Author: Noah Piqu� (noah.pique@psi.ch)
+// Author: Noah Piqué (noah.pique@psi.ch)
//
//-------------------------------------------------------------------------------------------------
//
diff --git a/Core/Application/VARH_VariableHandler.c b/Core/Application/VARH_VariableHandler.c
index 6d95306..f4500da 100644
--- a/Core/Application/VARH_VariableHandler.c
+++ b/Core/Application/VARH_VariableHandler.c
@@ -28,7 +28,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "VARH_VariableHandler.h"
// Toolbox
@@ -72,7 +71,7 @@ LOCAL osMutexId_t m_pstMutexID = NULL;
LOCAL CONST VARH_StVarInfo m_astVarInfo[VARH_eNumberOfVariables] =
{
- { VARH_FLAGINFO_BOOL, (VARH_UVariable)(U32)1, (VARH_UVariable)(U32)0, (VARH_UVariable)(U32)1}, // VARH_eMode
+ { VARH_FLAGINFO_NONE, (VARH_UVariable)(U32)1, (VARH_UVariable)(U32)0, (VARH_UVariable)(U32)1}, // VARH_eMode
{ VARH_FLAGINFO_FLOAT, (VARH_UVariable)0.0f, (VARH_UVariable)-2.0f, (VARH_UVariable)12.0f}, // VARH_eControlVoltage
diff --git a/Core/Drivers/ADCD_AdcDriver.c b/Core/Drivers/ADCD_AdcDriver.c
index e083640..7c8bc2c 100644
--- a/Core/Drivers/ADCD_AdcDriver.c
+++ b/Core/Drivers/ADCD_AdcDriver.c
@@ -30,7 +30,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "ADCD_AdcDriver.h"
// Drivers
diff --git a/Core/Drivers/ANPI_AnalogPortsIn.c b/Core/Drivers/ANPI_AnalogPortsIn.c
index 6da39d4..8d3077c 100644
--- a/Core/Drivers/ANPI_AnalogPortsIn.c
+++ b/Core/Drivers/ANPI_AnalogPortsIn.c
@@ -28,11 +28,8 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "ANPI_AnalogPortsIn.h"
-
-
//Application
#include "../Application/VARH_VariableHandler.h"
diff --git a/Core/Drivers/ANPO_AnalogPortsOut.c b/Core/Drivers/ANPO_AnalogPortsOut.c
index b1c19fb..4c7f9db 100644
--- a/Core/Drivers/ANPO_AnalogPortsOut.c
+++ b/Core/Drivers/ANPO_AnalogPortsOut.c
@@ -30,7 +30,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "ANPO_AnalogPortsOut.h"
// Toolbox
diff --git a/Core/Drivers/CAND_CanDriver.c b/Core/Drivers/CAND_CanDriver.c
index dbddd72..51535df 100644
--- a/Core/Drivers/CAND_CanDriver.c
+++ b/Core/Drivers/CAND_CanDriver.c
@@ -30,7 +30,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "CAND_CanDriver.h"
// Toolbox
diff --git a/Core/Drivers/DIPO_DigitalPorts.c b/Core/Drivers/DIPO_DigitalPorts.c
index b3fc983..3b118d6 100644
--- a/Core/Drivers/DIPO_DigitalPorts.c
+++ b/Core/Drivers/DIPO_DigitalPorts.c
@@ -7,7 +7,7 @@
//-------------------------------------------------------------------------------------------------
//
// Project: Peltier Controller V2
-// Author: Noah Piqu� (noah.pique@psi.ch)
+// Author: Noah Piqué (noah.pique@psi.ch)
//
//-------------------------------------------------------------------------------------------------
//
@@ -34,7 +34,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "DIPO_DigitalPorts.h"
//Application
diff --git a/Core/Drivers/ERRH_ErrorHandler.c b/Core/Drivers/ERRH_ErrorHandler.c
index d11b414..5b98ee2 100644
--- a/Core/Drivers/ERRH_ErrorHandler.c
+++ b/Core/Drivers/ERRH_ErrorHandler.c
@@ -30,7 +30,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "ERRH_ErrorHandler.h"
// Toolbox
diff --git a/Core/Drivers/SPID_SpiDriver.c b/Core/Drivers/SPID_SpiDriver.c
index 52988e5..96c946f 100644
--- a/Core/Drivers/SPID_SpiDriver.c
+++ b/Core/Drivers/SPID_SpiDriver.c
@@ -30,7 +30,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "SPID_SpiDriver.h"
// Application
diff --git a/Core/Drivers/TEMP_Temperature.c b/Core/Drivers/TEMP_Temperature.c
index 9731aa4..f1dc4fe 100644
--- a/Core/Drivers/TEMP_Temperature.c
+++ b/Core/Drivers/TEMP_Temperature.c
@@ -28,7 +28,6 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "TEMP_Temperature.h"
// Application
@@ -38,7 +37,7 @@
#include "../Toolbox/UTIL_Utility.h"
// Drivers
-#include "ADCD_ADCDriver.h"
+#include "ADCD_AdcDriver.h"
// include STM32 drivers
#include "stm32l4xx_hal.h"
diff --git a/Core/Drivers/USFL_UserFlash.c b/Core/Drivers/USFL_UserFlash.c
index 3483402..4f7e17d 100644
--- a/Core/Drivers/USFL_UserFlash.c
+++ b/Core/Drivers/USFL_UserFlash.c
@@ -45,11 +45,10 @@
// Description: List of required include files.
//=================================================================================================
-#include "../PDEF_ProjectDefinitions.h"
#include "USFL_UserFlash.h"
// Toolbox
-#include "../Toolbox/UTIL_Utility.h"
+#include "../Application/VARH_VariableHandler.h"
// include STM32 drivers
#include "stm32l4xx_hal.h"
@@ -64,9 +63,11 @@
#define USERFLASHSIZE (2000/4) // Bytes -> 64 Bits
#define USERFLASHPAGE (63)
-#define STARTDEF 0xAA01F055
+#define VARDEF 0xABCDEF
+
+#define STARTDEF (((U64)0xAA01F055 << 32) + (VARDEF << 2))
+
-#define VARDEF 0xABCDEF00
//=================================================================================================
// Section: MACROS
@@ -100,7 +101,7 @@ FLASH_EraseInitTypeDef stEreaseInit = {
// Description: Definition of local variables (visible by this module only).
//=================================================================================================
-
+U32 u32VarPointer = 0;
//=================================================================================================
// Section: LOCAL CONSTANTS
@@ -116,6 +117,8 @@ __attribute__((__section__(".user_data"))) const U64 UserFlash[USERFLASHSIZE];
BOOL vEreaseUserFlash( void );
U32 vFindNextFreePointer( void );
+U32 u32FindLastPointer( void );
+U8 u8ConvertWordsToDoubleWords( U8 u8Words );
//=================================================================================================
// Section: GLOBAL FUNCTIONS
@@ -142,6 +145,14 @@ BOOL USFL_boInitializeModule( VOID )
return( boOK );
}
+VARH_UVariable USFL_uGetVariable ( void ){
+
+ if( u32VarPointer == 0 ) u32VarPointer = u32FindLastPointer();
+
+
+
+}
+
//=================================================================================================
@@ -150,27 +161,27 @@ BOOL USFL_boInitializeModule( VOID )
//=================================================================================================
//-------------------------------------------------------------------------------------------------
-// Function: vFindNextFreePointer
-// Description: Ereases the User Flash Sector
+// Function: u32FindNextFreePointer
+// Description: Finds the next free sector in the flash for saving variables
// Parameters: None
-// Returns: Boolean TRUE if successful
+// Returns: U32 next free pointer
//-------------------------------------------------------------------------------------------------
-U32 vFindNextFreePointer( void ){
+U32 u32FindNextFreePointer( void ){
BOOL boFound = FALSE;
- U32 u32Pointer = 1; // 0 is StartDef
+ U32 u32Pointer = u32VarPointer;
while(!boFound){
- if( (UserFlash[u32Pointer] & 0xFFFFFF00) == VARDEF ){
+ if( ( ( UserFlash[u32Pointer] >> 8 ) & 0xFFFFFF ) == VARDEF ){
U8 u8Size = UserFlash[u32Pointer] & 0xFF;
if( u8Size == 0 ){
boFound = TRUE;
} else {
- u32Pointer += u8Size + 1;
+ u32Pointer += u8ConvertWordsToDoubleWords(u8Size);
}
} else {
- return 0;
+ u32Pointer += 1;
}
if( u32Pointer >= USERFLASHSIZE ){
@@ -182,6 +193,58 @@ U32 vFindNextFreePointer( void ){
}
+//-------------------------------------------------------------------------------------------------
+// Function: u32FindLastPointer
+// Description: Finds the next free sector in the flash for saving variables
+// Parameters: None
+// Returns: U32 next free pointer
+//-------------------------------------------------------------------------------------------------
+U32 u32FindLastPointer( void ){
+
+ BOOL boFound = FALSE;
+ U32 u32Pointer = 0;
+ U8 u8LastSize = 0;
+
+ while(!boFound){
+
+ if( ( UserFlash[u32Pointer] >> 40) == VARDEF ){
+ U8 u8Size = UserFlash[u32Pointer] & 0xFF;
+ if( u8Size == 0 ){
+ boFound = TRUE;
+ u32Pointer -= u8ConvertWordsToDoubleWords(u8LastSize);
+ } else {
+ u32Pointer += u8ConvertWordsToDoubleWords(u8Size);
+ u8LastSize = u8Size;
+ }
+ } else {
+ u32Pointer += 1;
+ }
+
+ if( u32Pointer >= USERFLASHSIZE ){
+ u32Pointer = 1;
+ break;
+ }
+ }
+ return u32Pointer;
+}
+
+
+//-------------------------------------------------------------------------------------------------
+// Function: u8ConvertWordsToDoubleWords
+// Description: Converts 32Bit Word size to 64 Bit Double Word size for saving Vars
+// Parameters: U8 u8Words
+// Returns: U8 Double Words
+//-------------------------------------------------------------------------------------------------
+U8 u8ConvertWordsToDoubleWords( U8 u8Words ) {
+ U8 u8DWords;
+
+ u8Words += 1; // + VARDEF
+ u8DWords = u8Words / 2;
+ u8DWords += u8Words % 2;
+
+ return u8DWords;
+}
+
//-------------------------------------------------------------------------------------------------
// Function: vEreaseUserFlash
// Description: Ereases the User Flash Sector
@@ -191,10 +254,19 @@ U32 vFindNextFreePointer( void ){
BOOL vEreaseUserFlash( void ){
uint32_t u32PageError = 0;
- if( HAL_FLASHEx_Erase(&stEreaseInit, &u32PageError) != HAL_OK ){
+ BOOL boOK = TRUE;
+
+ HAL_FLASH_Unlock();
+ boOK &= HAL_FLASHEx_Erase(&stEreaseInit, &u32PageError) == HAL_OK ? TRUE : FALSE;
+
+ if( !boOK ){
return FALSE;
}
+ HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, (U32) &UserFlash[0], STARTDEF);
+
+ HAL_FLASH_Lock();
+
return TRUE;
}
diff --git a/Core/PDEF_ProjectDefinitions.h b/Core/PDEF_ProjectDefinitions.h
deleted file mode 100644
index e26f133..0000000
--- a/Core/PDEF_ProjectDefinitions.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//=================================================================================================
-//
-// Company: Paul Scherrer Institut
-// 5232 Villigen PSI
-// Switzerland
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Project: High Stability Current Source
-// Author: Lukas Kuenzi (lukas.kuenzi@psi.ch)
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Module: Project definitions
-// Filename: PDEF_ProjectDefinitions.h
-// Date: Handled by Subversion (version control system)
-// Revision: Handled by Subversion (version control system)
-// History: Handled by Subversion (version control system)
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Description: Project definitions
-//
-//=================================================================================================
-
-#ifndef PDEF_PROJECT_DEFINITIONS_H
-#define PDEF_PROJECT_DEFINITIONS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-//=================================================================================================
-// Section: INCLUDES
-// Description: List of required include files (visible by all modules).
-//=================================================================================================
-
-
-
-
-//=================================================================================================
-// Section: DEFINITIONS
-// Description: Definition of global constants (visible by all modules).
-//=================================================================================================
-
-// Firmare version:
-// example: "1.1.2"
-// 1. Digit: Major number for big changes = "01" and up
-// 2. Digit: Minor number for small changes = "1" and up
-// 3. Digit: Development version number = "1" and up
-#define PDEF_FW_VERSION_HEX 0x0001 // coding: 0xUVW
-// U: major number,
-// V: minor number,
-// W: development version
-
-// Compiler switches
-#define PDEF_FUNCTION_PARAMETER_CHECK_ENABLED FALSE
-#define PDEF_USE_ASSERTION TRUE
-#define PDEF_USE_STM32_FULL_ASSERT FALSE
-
-
-// definie interrupt priorities
-//-------------------------------------------------------------------------------------------------
-// preemption priority range: 0-15
-// sub priority range: no subpriority
-// 0: highest priority, 15: lowest priority
-// same priorities are allowed
-
-#define PDEF_NVIC_PRIORITY_GROUPING NVIC_PRIORITYGROUP_4
-
-#define PDEF_MSCB_IRQ_PREEMPT_PRIO 0
-#define PDEF_MSCB_IRQ_SUB_PRIO 0
-
-#define PDEF_RS485_IRQ_PREMPT_PRIO 0
-#define PDEF_RS485_IRQ_SUB_PRIO 0
-
-#define PDEF_EXTI_IRQ_PREEMPT_PRIO 1
-#define PDEF_EXTI_IRQ_SUB_PRIO 0
-
-#define PDEF_ADCS_SPI_IRQ_PREEMPT_PRIO 1
-#define PDEF_ADCS_SPI_IRQ_SUB_PRIO 0
-
-#define PDEF_DACS_SPI_IRQ_PREEMPT_PRIO 1
-#define PDEF_DACS_SPI_IRQ_SUB_PRIO 0
-
-#define PDEF_CHARGE_PUMP_DAC_SPI_IRQ_PREEMPT_PRIO 1
-#define PDEF_CHARGE_PUMP_DAC_SPI_IRQ_SUB_PRIO 0
-
-#define PDEF_CRC_DMA_IRQ_PREEMPT_PRIO 1
-#define PDEF_CRC_DMA_IRQ_SUB_PRIO 0
-
-#define PDEF_FLASH_IRQ_PREEMPT_PRIO 1
-#define PDEF_FLASH_IRQ_SUB_PRIO 0
-
-#define PDEF_SVC_IRQ_PREEMPT_PRIO 14 // must be one preempt prio higher than PendSV
-#define PDEF_SVC_IRQ_SUB_PRIO 0
-
-#define PDEF_PENDSV_IRQ_PREEMPT_PRIO 15 // lowest priority = same as systick
-#define PDEF_PENDSV_IRQ_SUB_PRIO 0
-
-//=================================================================================================
-// Section: MACROS
-// Description: Definition of global macros (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: ENUMERATIONS
-// Description: Definition of global enumerations (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: STRUCTURES
-// Description: Definition of global Structures (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: GLOBAL VARIABLES
-// Description: Definition of global variables (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: GLOBAL CONSTANTS
-// Description: Definition of global constants (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: GLOBAL FUNCTIONS (PROTOTYPES)
-// Description: Definition of global functions (visible by all modules).
-//=================================================================================================
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/Core/SDEF_StandardDefinitions.h b/Core/SDEF_StandardDefinitions.h
index 59fa414..504f644 100644
--- a/Core/SDEF_StandardDefinitions.h
+++ b/Core/SDEF_StandardDefinitions.h
@@ -7,7 +7,7 @@
//-------------------------------------------------------------------------------------------------
//
// Project: Peltier Controller V2
-// Author: Noah Piqu� (noah.pique@psi.ch)
+// Author: Noah Piqué (noah.pique@psi.ch)
//
//-------------------------------------------------------------------------------------------------
//
diff --git a/Core/TMPL_Template.c b/Core/TMPL_Template.c
deleted file mode 100644
index ed8da5b..0000000
--- a/Core/TMPL_Template.c
+++ /dev/null
@@ -1,136 +0,0 @@
-//=================================================================================================
-//
-// Company: Paul Scherrer Institut
-// 5232 Villigen PSI
-// Switzerland
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Project: SCS-3000
-// Author: Lukas Kuenzi (lukas.kuenzi@psi.ch)
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Module: Template source file
-// Filename: TMPL_Template.c
-// Date: Handled by Subversion (version control system)
-// Revision: Handled by Subversion (version control system)
-// History: Handled by Subversion (version control system)
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Description: Source file template
-//
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: INCLUDES
-// Description: List of required include files.
-//=================================================================================================
-
-#include "TMPL_Template.h"
-
-
-
-//=================================================================================================
-// Section: DEFINITIONS
-// Description: Definition of local constants (visible by this module only).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: MACROS
-// Description: Definition of local macros (visible by this module only).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: ENUMERATIONS
-// Description: Definition of local enumerations (visible by this module only).
-//=================================================================================================
-
-typedef enum
-{
- eX = 0,
- eY
-} EnExample;
-
-
-
-//=================================================================================================
-// Section: STRUCTURES
-// Description: Definition of local Structures (visible by this module only).
-//=================================================================================================
-
-typedef struct
-{
- U32 u32X;
- BOOL boY;
-} StExample;
-
-
-
-//=================================================================================================
-// Section: LOCAL VARIABLES
-// Description: Definition of local variables (visible by this module only).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: LOCAL CONSTANTS
-// Description: Definition of local constants (visible by this module only).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: LOCAL FUNCTIONS (PROTOTYPES)
-// Description: Definition of local functions (visible by this module only).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: EXTERNAL FUNCTIONS
-// Description: Definition of external (global) functions.
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: EXTERNAL VARIABLES
-// Description: Definition of external (global) variables.
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: GLOBAL FUNCTIONS
-// Description: Definition (implementation) of global functions.
-//=================================================================================================
-
-//-------------------------------------------------------------------------------------------------
-// Function: TMPL_boInitializeModule
-// Description: Initializes the module. Function must be called once immediately after power-up.
-// Parameters: None
-// Returns: Boolean TRUE if successful
-//-------------------------------------------------------------------------------------------------
-
-BOOL TMPL_boInitializeModule( VOID )
-{
-
-
- return( FALSE );
-}
-
-
-
-//=================================================================================================
-// Section: LOCAL FUNCTIONS
-// Descriptionn: Definition (implementation) of local functions.
-//=================================================================================================
diff --git a/Core/TMPL_Template.h b/Core/TMPL_Template.h
deleted file mode 100644
index 9736e1e..0000000
--- a/Core/TMPL_Template.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//=================================================================================================
-//
-// Company: Paul Scherrer Institut
-// 5232 Villigen PSI
-// Switzerland
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Project: SCS-3000
-// Author: Lukas Kuenzi (lukas.kuenzi@psi.ch)
-//
-//-------------------------------------------------------------------------------------------------
-//
-// Module: Header File Template
-// Filename: TMPL_Template.h
-// Date: Handled by Subversion (version control system)
-// Revision: Handled by Subversion (version control system)
-// History: Handled by Subversion (version control system)
-//
-//-------------------------------------------------------------------------------------------------
-
-#ifndef TMPL_TEMPLATE_H
-#define TMPL_TEMPLATE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-//=================================================================================================
-// Section: INCLUDES
-// Description: List of required include files (visible by all modules).
-//=================================================================================================
-
-#include "SDEF_StandardDefinitions.h"
-
-
-
-//=================================================================================================
-// Section: DEFINITIONS
-// Description: Definition of global constants (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: MACROS
-// Description: Definition of global macros (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: ENUMERATIONS
-// Description: Definition of global enumerations (visible by all modules).
-//=================================================================================================
-
-typedef enum
-{
- TMPL_eX = 0,
- TMPL_eY
-} TMPL_EnExample;
-
-
-
-//=================================================================================================
-// Section: STRUCTURES
-// Description: Definition of global Structures (visible by all modules).
-//=================================================================================================
-
-typedef struct
-{
- U32 u32X;
- BOOL boY;
-} TMPL_StExample;
-
-
-
-//=================================================================================================
-// Section: GLOBAL VARIABLES
-// Description: Definition of global variables (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: GLOBAL CONSTANTS
-// Description: Definition of global constants (visible by all modules).
-//=================================================================================================
-
-
-
-//=================================================================================================
-// Section: GLOBAL FUNCTIONS (PROTOTYPES)
-// Description: Definition of global functions (visible by all modules).
-//=================================================================================================
-
-BOOL TMPL_boInitializeModule( VOID );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/STM32Make.make b/STM32Make.make
index 2bde47a..755049e 100644
--- a/STM32Make.make
+++ b/STM32Make.make
@@ -56,7 +56,6 @@ Core/Src/stm32l4xx_it.c \
Core/Src/syscalls.c \
Core/Src/sysmem.c \
Core/Src/system_stm32l4xx.c \
-Core/TMPL_Template.c \
Core/Toolbox/UTIL_Utility.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c \
@@ -187,7 +186,8 @@ CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-
CXXFLAGS = $(MCU) $(CXX_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections -feliminate-unused-debug-types
ifeq ($(DEBUG), 1)
-CFLAGS += -g -gdwarf-2
+CFLAGS += -g -gdwarf -ggdb
+CXXFLAGS += -g -gdwarf -ggdb
endif
# Add additional flags
@@ -275,6 +275,12 @@ erase: $(BUILD_DIR)/$(TARGET).elf
#######################################
clean:
cmd /c rd /s /q $(BUILD_DIR)
+
+#######################################
+# custom makefile rules
+#######################################
+
+
#######################################
# dependencies