diff --git a/Doxyfile b/Doxyfile index 0d3eda2..abcb7cb 100755 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "HARMcksL: ARM HAL toolbox (yet STM32 oriented)" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.5 +PROJECT_NUMBER = 0.6 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -2047,15 +2047,15 @@ PREDEFINED = DOXY=1 \ PACK__ \ WEAK__ \ INLINE__ \ - __INLINE \ - __STATIC_INLINE \ + __INLINE=inline \ + "__STATIC_INLINE=static inline" \ __WEAK \ - __IO \ - __O \ - __I \ - __IOM \ - __OM \ - __IM \ + __IO=volatile \ + __O=volatile \ + "__I=volatile const" \ + __IOM=volatile \ + __OM=volatile \ + "__IM=volatile const" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/FctERR.c b/FctERR.c index 5a4b1f8..327900a 100755 --- a/FctERR.c +++ b/FctERR.c @@ -1,6 +1,6 @@ /*!\file FctERR.c ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief errors to SMFSW FctERR code diff --git a/FctERR.h b/FctERR.h index 8878185..8ddf783 100755 --- a/FctERR.h +++ b/FctERR.h @@ -1,6 +1,6 @@ /*!\file FctERR.h ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief errors to SMFSW FctERR declarations diff --git a/GPIO_ex.c b/GPIO_ex.c index d6f2463..2824236 100755 --- a/GPIO_ex.c +++ b/GPIO_ex.c @@ -1,6 +1,6 @@ /*!\file GPIO_ex.c ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Simple extension for GPIOs diff --git a/GPIO_ex.h b/GPIO_ex.h index d4ae3a5..3251840 100755 --- a/GPIO_ex.h +++ b/GPIO_ex.h @@ -1,6 +1,6 @@ /*!\file GPIO_ex.h ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Simple extension for GPIOs @@ -110,7 +110,7 @@ __INLINE void INLINE__ write_GPIO(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, eActOu #if defined(VERBOSE) char port[10] = ""; str_GPIO_name(port, GPIOx, GPIO_Pin); - printf("Written %s to %u (%lums)\n", port, HAL_GPIO_ReadPin(GPIOx, GPIO_Pin), HAL_GetTick()); + printf("Written %s to %u (%lums)\r\n", port, HAL_GPIO_ReadPin(GPIOx, GPIO_Pin), HAL_GetTick()); #endif } } @@ -129,7 +129,7 @@ __INLINE GPIO_PinState INLINE__ read_GPIO(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin GPIO_PinState pin = HAL_GPIO_ReadPin(GPIOx, GPIO_Pin); char port[10] = ""; str_GPIO_name(port, GPIOx, GPIO_Pin); - printf("Read %s is %u (%lums)\n", port, pin, HAL_GetTick()); + printf("Read %s is %u (%lums)\r\n", port, pin, HAL_GetTick()); return pin; #else return HAL_GPIO_ReadPin(GPIOx, GPIO_Pin); diff --git a/HARMcksL_v0_5.pdf b/HARMcksL_v0_6.pdf similarity index 73% rename from HARMcksL_v0_5.pdf rename to HARMcksL_v0_6.pdf index 2da53ce..11e6647 100755 Binary files a/HARMcksL_v0_5.pdf and b/HARMcksL_v0_6.pdf differ diff --git a/PWM.c b/PWM.c index 3610627..18bc304 100755 --- a/PWM.c +++ b/PWM.c @@ -1,6 +1,6 @@ /*!\file PWM.c ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Simple PWM handling diff --git a/PWM.h b/PWM.h index f929bd3..f59cbdd 100755 --- a/PWM.h +++ b/PWM.h @@ -1,6 +1,6 @@ /*!\file PWM.h ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Simple PWM handling diff --git a/README.md b/README.md index b7837d9..d3d15ab 100755 --- a/README.md +++ b/README.md @@ -17,5 +17,5 @@ Doxygen generated documentation can be found in "HARMcksL_vXXX.pdf" ## Release Notes Detailed changes will come after v1.0 release -- v0.5: current +- v0.6: current - Still in beta for some time \ No newline at end of file diff --git a/exceptions.c b/exceptions.c index 3dc2122..10ca06a 100755 --- a/exceptions.c +++ b/exceptions.c @@ -1,6 +1,6 @@ /*!\file exceptions.c ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Debug tool helpers functions @@ -19,44 +19,44 @@ void stackDump(uint32_t stack[]) { enum { r0, r1, r2, r3, r12, lr, pc, psr}; - printf("r0 = 0x%08lx\n", stack[r0]); - printf("r1 = 0x%08lx\n", stack[r1]); - printf("r2 = 0x%08lx\n", stack[r2]); - printf("r3 = 0x%08lx\n", stack[r3]); - printf("r12 = 0x%08lx\n", stack[r12]); - printf("lr = 0x%08lx\n", stack[lr]); - printf("pc = 0x%08lx\n", stack[pc]); - printf("psr = 0x%08lx\n", stack[psr]); + printf("r0 = 0x%08lx\r\n", stack[r0]); + printf("r1 = 0x%08lx\r\n", stack[r1]); + printf("r2 = 0x%08lx\r\n", stack[r2]); + printf("r3 = 0x%08lx\r\n", stack[r3]); + printf("r12 = 0x%08lx\r\n", stack[r12]); + printf("lr = 0x%08lx\r\n", stack[lr]); + printf("pc = 0x%08lx\r\n", stack[pc]); + printf("psr = 0x%08lx\r\n", stack[psr]); } void HardFault_Handler_callback(uint32_t stack[]) { printf("Hard Fault handler\t"); - printf("SCB->HFSR = 0x%08lx\n", SCB->HFSR); + printf("SCB->HFSR = 0x%08lx\r\n", SCB->HFSR); if ((SCB->HFSR & (1 << 30)) != 0) { uint32_t CFSRValue = SCB->CFSR; printf("Hard Fault\t"); - printf("SCB->CFSR = 0x%08lx\n", CFSRValue); + printf("SCB->CFSR = 0x%08lx\r\n", CFSRValue); if ((SCB->CFSR & 0xFFFF0000) != 0) { printf("Usage fault: "); CFSRValue >>= 16; // right shift to lsb - if((CFSRValue & (1 << 9)) != 0) { printf("Zero div\n"); } + if((CFSRValue & (1 << 9)) != 0) { printf("Zero div\r\n"); } } if ((SCB->CFSR & 0xFF00) != 0) { CFSRValue = ((CFSRValue & 0x0000FF00) >> 8); // mask and shift - printf("Bus fault: 0x%02lx\n", CFSRValue); + printf("Bus fault: 0x%02lx\r\n", CFSRValue); } if ((SCB->CFSR & 0xFF) != 0) { CFSRValue &= 0x000000FF; // mask other faults - printf("Memory Management fault: 0x%02lx\n", CFSRValue); + printf("Memory Management fault: 0x%02lx\r\n", CFSRValue); } } @@ -70,7 +70,7 @@ void HardFault_Handler_callback(uint32_t stack[]) void Error_Handler_callback(uint32_t stack[]) { // TODO: maybe pass by another asm code to retrieve HAL error code if not in stack - printf("Error handler\n"); + printf("Error handler\r\n"); stackDump(stack); // __BKPT(01); diff --git a/stdream_rdir.c b/stdream_rdir.c index 707335a..05fc822 100755 --- a/stdream_rdir.c +++ b/stdream_rdir.c @@ -1,6 +1,6 @@ /*!\file stdream_rdir.c ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Stream redirection @@ -27,9 +27,11 @@ static char buf_stream[128] = ""; #warning "You have to define DBG_SERIAL in usart.h with an UART instance for this to work!" #endif -__STATIC_INLINE void INLINE__ print_uart(char* ptr, int len) +__STATIC_INLINE HAL_StatusTypeDef INLINE__ print_uart(char* ptr, int len) { - HAL_UART_Transmit(DBG_SERIAL, (uint8_t *) ptr, len, 30); + // TODO: find a way to determine if UART interrupts are enabled or not + return HAL_UART_Transmit(DBG_SERIAL, (uint8_t *) ptr, len, 30); + //return HAL_UART_Transmit_IT(DBG_SERIAL, (uint8_t *) ptr, len); } #endif diff --git a/stdream_rdir.h b/stdream_rdir.h index a5859c4..25f2482 100755 --- a/stdream_rdir.h +++ b/stdream_rdir.h @@ -1,6 +1,6 @@ /*!\file stdream_rdir.h ** \author SMFSW -** \version v0.5 +** \version v0.6 ** \date 2017 ** \copyright MIT (c) 2017, SMFSW ** \brief Stream redirection header