|
|
@ -16,80 +16,60 @@ static void handle_status(const char* func, PB_CB_STATUS status_code)
|
|
|
|
#if PB_CB_U8
|
|
|
|
#if PB_CB_U8
|
|
|
|
static PB_CB_STATUS p_cb_u8_push(p_cb_double* cbuffer, uint8_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u8_push(p_cb_double* cbuffer, uint8_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u8_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u8_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u8_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_u8_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- uint16_t
|
|
|
|
// Circular Buffer Prototypes -- uint16_t
|
|
|
|
#if PB_CB_U16
|
|
|
|
#if PB_CB_U16
|
|
|
|
static PB_CB_STATUS p_cb_u16_push(p_cb_double* cbuffer, uint16_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u16_push(p_cb_double* cbuffer, uint16_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u16_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u16_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u16_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_u16_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- uint32_t
|
|
|
|
// Circular Buffer Prototypes -- uint32_t
|
|
|
|
#if PB_CB_U32
|
|
|
|
#if PB_CB_U32
|
|
|
|
static PB_CB_STATUS p_cb_u32_push(p_cb_double* cbuffer, uint32_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u32_push(p_cb_double* cbuffer, uint32_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u32_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u32_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u32_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_u32_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- uint64_t
|
|
|
|
// Circular Buffer Prototypes -- uint64_t
|
|
|
|
#if PB_CB_U64
|
|
|
|
#if PB_CB_U64
|
|
|
|
static PB_CB_STATUS p_cb_u64_push(p_cb_double* cbuffer, uint64_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u64_push(p_cb_double* cbuffer, uint64_t value);
|
|
|
|
static PB_CB_STATUS p_cb_u64_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u64_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_u64_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_u64_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- int8_t
|
|
|
|
// Circular Buffer Prototypes -- int8_t
|
|
|
|
#if PB_CB_I8
|
|
|
|
#if PB_CB_I8
|
|
|
|
static PB_CB_STATUS p_cb_i8_push(p_cb_double* cbuffer, int8_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i8_push(p_cb_double* cbuffer, int8_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i8_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i8_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i8_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_i8_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- int16_t
|
|
|
|
// Circular Buffer Prototypes -- int16_t
|
|
|
|
#if PB_CB_I16
|
|
|
|
#if PB_CB_I16
|
|
|
|
static PB_CB_STATUS p_cb_i16_push(p_cb_double* cbuffer, int16_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i16_push(p_cb_double* cbuffer, int16_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i16_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i16_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i16_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_i16_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- int32_t
|
|
|
|
// Circular Buffer Prototypes -- int32_t
|
|
|
|
#if PB_CB_I32
|
|
|
|
#if PB_CB_I32
|
|
|
|
static PB_CB_STATUS p_cb_i32_push(p_cb_double* cbuffer, int32_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i32_push(p_cb_double* cbuffer, int32_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i32_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i32_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i32_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_i32_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- int64_t
|
|
|
|
// Circular Buffer Prototypes -- int64_t
|
|
|
|
#if PB_CB_I64
|
|
|
|
#if PB_CB_I64
|
|
|
|
static PB_CB_STATUS p_cb_i64_push(p_cb_double* cbuffer, int64_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i64_push(p_cb_double* cbuffer, int64_t value);
|
|
|
|
static PB_CB_STATUS p_cb_i64_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i64_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_i64_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_i64_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- Float
|
|
|
|
// Circular Buffer Prototypes -- Float
|
|
|
|
#if PB_CB_FLOAT
|
|
|
|
#if PB_CB_FLOAT
|
|
|
|
static PB_CB_STATUS p_cb_float_push(p_cb_double* cbuffer, float value);
|
|
|
|
static PB_CB_STATUS p_cb_float_push(p_cb_double* cbuffer, float value);
|
|
|
|
static PB_CB_STATUS p_cb_float_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_float_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_float_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_float_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Prototypes -- Double
|
|
|
|
// Circular Buffer Prototypes -- Double
|
|
|
|
#if PB_CB_DOUBLE
|
|
|
|
#if PB_CB_DOUBLE
|
|
|
|
static PB_CB_STATUS p_cb_double_push(p_cb_double* cbuffer, double value);
|
|
|
|
static PB_CB_STATUS p_cb_double_push(p_cb_double* cbuffer, double value);
|
|
|
|
static PB_CB_STATUS p_cb_double_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_double_empty(p_cb_double* cbuffer);
|
|
|
|
static PB_CB_STATUS p_cb_double_is_full(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
static PB_CB_STATUS p_cb_double_is_empty(p_cb_double* cbuffer);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Circular Buffer Definitions -- uint8_t
|
|
|
|
// Circular Buffer Definitions -- uint8_t
|
|
|
@ -354,7 +334,6 @@ PB_CB_STATUS p_cb_double_init(p_cb_double* circ_buffer, double* buff, uint32_t m
|
|
|
|
ret = PB_CB_BAD_BUFFER_SIZE;
|
|
|
|
ret = PB_CB_BAD_BUFFER_SIZE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("init\r\n");
|
|
|
|
|
|
|
|
circ_buffer->buffer = buff;
|
|
|
|
circ_buffer->buffer = buff;
|
|
|
|
circ_buffer->max_len = (uint16_t)max_length;
|
|
|
|
circ_buffer->max_len = (uint16_t)max_length;
|
|
|
|
circ_buffer->head = 0;
|
|
|
|
circ_buffer->head = 0;
|
|
|
|