diff --git a/api/log/lib/include/std_out/log.h b/api/log/lib/include/std_out/log.h index 9b56ecade..768c3d5c5 100644 --- a/api/log/lib/include/std_out/log.h +++ b/api/log/lib/include/std_out/log.h @@ -57,6 +57,15 @@ extern "C"{ * @{ */ +/*! + * \brief Return values. + */ +typedef enum +{ + LOG_SUCCESS = 0, /*!< Success. */ + LOG_ERROR = (-1) /*!< Error. */ +} log_err_t; + /*! * \brief Log level values */ @@ -113,8 +122,10 @@ typedef struct * * @param[in] log LOG context object. * @param[in] cfg LOG configuration structure. + * + * @return Returns a value from @ref log_err_t. */ -void log_init ( log_t *log, log_cfg_t *cfg ); +log_err_t log_init ( log_t *log, log_cfg_t *cfg ); /** * @brief Printf function. diff --git a/api/log/lib/include/uart/log.h b/api/log/lib/include/uart/log.h index f44fec48a..5bc1fd78b 100644 --- a/api/log/lib/include/uart/log.h +++ b/api/log/lib/include/uart/log.h @@ -59,6 +59,15 @@ extern "C"{ * @{ */ +/*! + * \brief Return values. + */ +typedef enum +{ + LOG_SUCCESS = 0, /*!< Success. */ + LOG_ERROR = (-1) /*!< Error. */ +} log_err_t; + /*! * \brief Log level values */ @@ -133,8 +142,10 @@ typedef struct * * @param[in] log LOG context object. * @param[in] cfg LOG configuration structure. + * + * @return Returns a value from @ref log_err_t. */ -void log_init ( log_t *log, log_cfg_t *cfg ); +log_err_t log_init ( log_t *log, log_cfg_t *cfg ); /** * @brief Printf function. diff --git a/api/log/lib/src/std_out/log.c b/api/log/lib/src/std_out/log.c index 85f9c7a6c..2a82ba4e1 100644 --- a/api/log/lib/src/std_out/log.c +++ b/api/log/lib/src/std_out/log.c @@ -46,9 +46,11 @@ static void api_log ( log_t *log, char * prefix, const code char * __generic_ptr printf_me( "\n" ); } -void log_init ( log_t *log, log_cfg_t *cfg ) +log_err_t log_init ( log_t *log, log_cfg_t *cfg ) { log->log_level = cfg->level; + + return LOG_SUCCESS; } void log_printf ( log_t *log, const code char * __generic_ptr f,... ) diff --git a/api/log/lib/src/uart/log.c b/api/log/lib/src/uart/log.c index d480a749a..a321edba0 100644 --- a/api/log/lib/src/uart/log.c +++ b/api/log/lib/src/uart/log.c @@ -43,6 +43,8 @@ static uint8_t uart_tx_buf[ 256 ]; static uint8_t uart_rx_buf[ 256 ]; +#define LOG_ASSERT_EQUAL(expected, actual) if (expected != actual) { return LOG_ERROR; } else { } + static void api_log ( log_t *log, char * prefix, const code char * __generic_ptr f, va_list ap ) { uart_print( &log->uart, prefix ); @@ -50,9 +52,10 @@ static void api_log ( log_t *log, char * prefix, const code char * __generic_ptr uart_print( &log->uart, "\r\n" ); } -void log_init ( log_t *log, log_cfg_t *cfg ) +log_err_t log_init ( log_t *log, log_cfg_t *cfg ) { uart_config_t uart_cfg; + log_err_t status = LOG_SUCCESS; // Default config uart_configure_default( &uart_cfg ); @@ -67,14 +70,21 @@ void log_init ( log_t *log, log_cfg_t *cfg ) uart_cfg.tx_ring_size = sizeof( uart_tx_buf ); uart_cfg.rx_ring_size = sizeof( uart_rx_buf ); - uart_open( &log->uart, &uart_cfg ); - uart_set_baud( &log->uart, cfg->baud ); - uart_set_parity( &log->uart, UART_PARITY_DEFAULT ); - uart_set_stop_bits( &log->uart, UART_STOP_BITS_DEFAULT ); - uart_set_data_bits( &log->uart, UART_DATA_BITS_DEFAULT ); + status = uart_open( &log->uart, &uart_cfg ); + LOG_ASSERT_EQUAL(status, LOG_SUCCESS); + status = uart_set_baud( &log->uart, cfg->baud ); + LOG_ASSERT_EQUAL(status, LOG_SUCCESS); + status = uart_set_parity( &log->uart, UART_PARITY_DEFAULT ); + LOG_ASSERT_EQUAL(status, LOG_SUCCESS); + status = uart_set_stop_bits( &log->uart, UART_STOP_BITS_DEFAULT ); + LOG_ASSERT_EQUAL(status, LOG_SUCCESS); + status = uart_set_data_bits( &log->uart, UART_DATA_BITS_DEFAULT ); + LOG_ASSERT_EQUAL(status, LOG_SUCCESS); uart_set_blocking( &log->uart, true ); log->log_level = cfg->level; + + return status; } void log_printf ( log_t *log, const code char * __generic_ptr f,... ) diff --git a/changelog/v2.11.4/changelog.md b/changelog/v2.11.4/changelog.md new file mode 100644 index 000000000..2ab2a343d --- /dev/null +++ b/changelog/v2.11.4/changelog.md @@ -0,0 +1,77 @@ +
+ +
+ +--- + +**[BACK TO MAIN FILE](../../changelog.md)** + +--- + +# `v2.11.4` + ++ released: 2024-10-18 + +## Changes + ++ [`v2.11.4`](#v2114) + + [Changes](#changes) + + [Improvements](#improvements) + + [mikroSDK](#mikrosdk) + + [CORE](#core) + + [Fixes](#fixes) + + [mikroSDK](#mikrosdk-1) + + [CORE](#core-1) + +### Improvements + +#### mikroSDK + ++ Updated logger library error handling + + `log_init` now returns an error (`-1`) if any of the configuration API calls used in it failed + +#### CORE + ++ Removed `READONLY` option from linker scripts for following MCUs (CLANG) + + `stm32h7s3a8.ld` + + `stm32h7s3i8.ld` + + `stm32h7s3l8.ld` + + `stm32h7s3r8.ld` + + `stm32h7s3v8.ld` + + `stm32h7s3z8.ld` + + `stm32h7s7a8.ld` + + `stm32h7s7i8.ld` + + `stm32h7s7l8.ld` + + `stm32h7s7z8.ld` + + `stm32u083cc.ld` + + `stm32u083hc.ld` + + `stm32u083kc.ld` + + `stm32u083mc.ld` + + `stm32u083rc.ld` ++ Updated project templates to report better errors + + Case when openning designer project without a setup with TFT + + Now reports error in the output + +### Fixes + +#### mikroSDK + ++ Fixed following MCU cards to have correct TFT pinout definitions + + [mcu_card_3_for_pic32](../../bsp/board/include/mcu_cards/mcu_card_3_for_pic32/mcu_card.h) + + [mcu_card_4_for_kinetis](../../bsp/board/include/mcu_cards/mcu_card_4_for_kinetis/mcu_card.h) + + [mcu_card_for_pic32](../../bsp/board/include/mcu_cards/mcu_card_for_pic32/mcu_card.h) + + [sibrain_for_dspic33ep512mu814](../../bsp/board/include/mcu_cards/sibrain_for_dspic33ep512mu814/mcu_card.h) + + [sibrain_for_dspic33fj256gp710a](../../bsp/board/include/mcu_cards/sibrain_for_dspic33fj256gp710a/mcu_card.h) + + [sibrain_for_pic24ep512gu814](../../bsp/board/include/mcu_cards/sibrain_for_pic24ep512gu814/mcu_card.h) + + [sibrain_for_pic24hj256gp610](../../bsp/board/include/mcu_cards/sibrain_for_pic24hj256gp610/mcu_card.h) + +#### CORE + ++ Removed `CAN` schema file (clock configuration) for `PIC32MZ1024EFE144` + + Added by mistake initially + +--- + +**[BACK TO MAIN FILE](../../changelog.md)** + +--- diff --git a/manifest.json b/manifest.json index 3ceecbf2f..e04154930 100644 --- a/manifest.json +++ b/manifest.json @@ -3,5 +3,5 @@ "display-name": "mikroSDK", "description": "MikroSDK 2.0 is an embedded software development framework designed to simplify and accelerate application development on Mikroe hardware platform, specifically for Click Boards and other extension board drivers, on a broad range of microcontroller vendors and architectures. It includes peripheral libraries and drivers, middleware, board support, and application layer libraries among others.", "icon": "images/icon-mikroSDK.png", - "manifest-version": "1.0.17" + "manifest-version": "1.0.18" }