Si5351 increment PATCHLEVEL, beautifying

This commit is contained in:
Thomas Kuschel 2022-07-16 01:57:35 +02:00
parent ca1dc53797
commit 41afeeee53
3 changed files with 5 additions and 6 deletions

View File

@ -118,7 +118,7 @@ typedef enum {
/* Exported macros -----------------------------------------------------------*/ /* Exported macros -----------------------------------------------------------*/
#define __SI5351__ 1 #define __SI5351__ 1
#define __SI5351_MINOR__ 0 #define __SI5351_MINOR__ 0
#define __SI5351_PATCHLEVEL__ 0 #define __SI5351_PATCHLEVEL__ 1
#define SI5351_VERSION (__SI5351__ * 10000 \ #define SI5351_VERSION (__SI5351__ * 10000 \
+ __SI5351_MINOR__ * 100 \ + __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_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); int si5351_set_phase(si5351_inst_t inst, uint8_t phase, uint8_t clk);
#if SI5351_DEFAULTS #if SI5351_DEFAULTS
si5351_inst_t si5351_initialize(void * i2c_handle); si5351_inst_t si5351_initialize(void * i2c_handle);
int si5351_deinitialize(void); int si5351_deinitialize(void);

View File

@ -205,7 +205,7 @@ int main(void)
si5351_inst = si5351_init(&hi2c1, 25000000, 0x60, 0); si5351_inst = si5351_init(&hi2c1, 25000000, 0x60, 0);
{ {
int ready = si5351_i2c_ready(si5351_inst); 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 #if 0
puts("Registers of Device No. 1"); 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); __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), 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()); (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__); printf("GNU Compiler Collection V%u.%u.%u\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
puts("Byte Order: little-endian"); puts("Byte Order: little-endian");

View File

@ -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 = malloc(sizeof(ringbuf_t) + size * sizeof(uint8_t));
rb = calloc(1, sizeof(ringbuf_t) + size * sizeof(uint8_t)); rb = calloc(1, sizeof(ringbuf_t) + size * sizeof(uint8_t));
if (rb == NULL) { if (rb == NULL) {
puts("Memory not allocated.\n"); puts("Memory not allocated.");
exit(0); exit(0);
} else { } else {
puts("Memory successfully allocated.\n"); //puts("Memory successfully allocated.");
// the data area is connected to the structure // the data area is connected to the structure
rb->buf = (uint8_t *)rb + sizeof(ringbuf_t); rb->buf = (uint8_t *)rb + sizeof(ringbuf_t);
rb->size = (uint16_t)size; rb->size = (uint16_t)size;