From 41afeeee534ff36271ee68c4e0708bf8de411f1e Mon Sep 17 00:00:00 2001 From: Thomas Kuschel Date: Sat, 16 Jul 2022 01:57:35 +0200 Subject: [PATCH] Si5351 increment PATCHLEVEL, beautifying --- Core/Inc/stm32_si5351.h | 3 +-- Core/Src/main.c | 4 ++-- Core/Src/ringbuf.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/Inc/stm32_si5351.h b/Core/Inc/stm32_si5351.h index 84fcc30..e4f2fe9 100644 --- a/Core/Inc/stm32_si5351.h +++ b/Core/Inc/stm32_si5351.h @@ -118,7 +118,7 @@ typedef enum { /* Exported macros -----------------------------------------------------------*/ #define __SI5351__ 1 #define __SI5351_MINOR__ 0 -#define __SI5351_PATCHLEVEL__ 0 +#define __SI5351_PATCHLEVEL__ 1 #define SI5351_VERSION (__SI5351__ * 10000 \ + __SI5351_MINOR__ * 100 \ @@ -143,7 +143,6 @@ int si5351_set_clk(si5351_inst_t inst, uint32_t frequency, uint8_t clk, si5351_p int si5351_set_clk_phase(si5351_inst_t inst, uint32_t frequency, double phase, uint8_t clk, si5351_pll_t pll); int si5351_set_phase(si5351_inst_t inst, uint8_t phase, uint8_t clk); - #if SI5351_DEFAULTS si5351_inst_t si5351_initialize(void * i2c_handle); int si5351_deinitialize(void); diff --git a/Core/Src/main.c b/Core/Src/main.c index 2c9bcad..d210853 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -205,7 +205,7 @@ int main(void) si5351_inst = si5351_init(&hi2c1, 25000000, 0x60, 0); { int ready = si5351_i2c_ready(si5351_inst); - printf("Si5351 device is %s\n", (ready==1) ? "ready" : "N/A"); + printf("Si5351 device is %s.\n", (ready==1) ? "ready" : "N/A"); } #if 0 puts("Registers of Device No. 1"); @@ -835,7 +835,7 @@ void print_system_info(void) { __STM32L4_CMSIS_VERSION_SUB1,__STM32L4_CMSIS_VERSION_SUB2,__STM32L4_CMSIS_VERSION_RC); printf("HAL Driver V%hu.%hu.%hu.%hu\n", (uint8_t)(HAL_GetHalVersion()>>24), (uint8_t)(HAL_GetHalVersion()>>16), (uint8_t)(HAL_GetHalVersion()>>8), (uint8_t) HAL_GetHalVersion()); - printf("Si5351 STM32-driver V%u.%u.%u\n", __SI5351__, __SI5351_MINOR__, __SI5351_PATCHLEVEL__); + printf("Si5351 Driver V%u.%u.%u\n", __SI5351__, __SI5351_MINOR__, __SI5351_PATCHLEVEL__); printf("GNU Compiler Collection V%u.%u.%u\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ puts("Byte Order: little-endian"); diff --git a/Core/Src/ringbuf.c b/Core/Src/ringbuf.c index 8b6ec14..808c064 100644 --- a/Core/Src/ringbuf.c +++ b/Core/Src/ringbuf.c @@ -55,10 +55,10 @@ struct ringbuf * ringbuf_create(size_t size, ringbuf_param_t param) { // rb = malloc(sizeof(ringbuf_t) + size * sizeof(uint8_t)); rb = calloc(1, sizeof(ringbuf_t) + size * sizeof(uint8_t)); if (rb == NULL) { - puts("Memory not allocated.\n"); + puts("Memory not allocated."); exit(0); } else { - puts("Memory successfully allocated.\n"); + //puts("Memory successfully allocated."); // the data area is connected to the structure rb->buf = (uint8_t *)rb + sizeof(ringbuf_t); rb->size = (uint16_t)size;