LCOV - code coverage report
Current view: top level - util - can_rcv_buffer.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 21 0
Test Date: 2026-02-15 13:08:52 Functions: 0.0 % 8 0
Branches: 0.0 % 2 0

             Branch data     Line data    Source code
       1                 :             : #include <stddef.h>
       2                 :             : 
       3                 :             : #include "can.h"
       4                 :             : #include "can_rcv_buffer.h"
       5                 :             : #include "safe_ring_buffer.h"
       6                 :             : 
       7                 :             : static srb_ctx_t buf;
       8                 :             : static bool overflow_flag;
       9                 :             : 
      10                 :           0 : void rcvb_init(void *pool, size_t pool_size) {
      11                 :           0 :         srb_init(&buf, pool, pool_size, sizeof(can_msg_t));
      12                 :           0 :         overflow_flag = false;
      13                 :           0 : }
      14                 :             : 
      15                 :           0 : void rcvb_push_message(const can_msg_t *msg) {
      16         [ #  # ]:           0 :         if (!srb_push(&buf, (void *)msg)) {
      17                 :           0 :                 overflow_flag = true;
      18                 :             :         }
      19                 :           0 : }
      20                 :             : 
      21                 :           0 : bool rcvb_has_overflowed(void) {
      22                 :           0 :         return overflow_flag;
      23                 :             : }
      24                 :             : 
      25                 :           0 : void rcvb_clear_overflow_flag(void) {
      26                 :           0 :         overflow_flag = false;
      27                 :           0 : }
      28                 :             : 
      29                 :           0 : bool rcvb_is_full(void) {
      30                 :           0 :         return srb_is_full(&buf);
      31                 :             : }
      32                 :             : 
      33                 :           0 : bool rcvb_is_empty(void) {
      34                 :           0 :         return srb_is_empty(&buf);
      35                 :             : }
      36                 :             : 
      37                 :           0 : bool rcvb_pop_message(can_msg_t *msg) {
      38                 :           0 :         return srb_pop(&buf, (void *)msg);
      39                 :             : }
      40                 :             : 
      41                 :           0 : bool rcvb_peek_message(can_msg_t *msg) {
      42                 :           0 :         return srb_peek(&buf, (void *)msg);
      43                 :             : }
        

Generated by: LCOV version 2.0-1