@@ -52,15 +52,15 @@ static void osdp_handle_in_byte(struct osdp_device *p, uint8_t *buf, int len)
52
52
/* Check for new packet beginning with [FF,53,...] sequence */
53
53
if (p -> last_byte == 0xFF && buf [0 ] == 0x53 ) {
54
54
buf [0 ] = 0xFF ;
55
- ring_buf_put (& p -> rx_buf , buf , 1 ); /* put last byte */
55
+ ring_buffer_write (& p -> rx_buf , buf , 1 ); /* put last byte */
56
56
buf [0 ] = 0x53 ;
57
- ring_buf_put (& p -> rx_buf , buf , len ); /* put rest */
57
+ ring_buffer_write (& p -> rx_buf , buf , len ); /* put rest */
58
58
p -> wait_for_mark = 0 ; /* Mark found. Clear flag */
59
59
}
60
60
p -> last_byte = buf [0 ];
61
61
return ;
62
62
}
63
- ring_buf_put (& p -> rx_buf , buf , len );
63
+ ring_buffer_write (& p -> rx_buf , buf , len );
64
64
}
65
65
66
66
static void osdp_uart_isr (const struct device * dev , void * user_data )
@@ -79,7 +79,7 @@ static void osdp_uart_isr(const struct device *dev, void *user_data)
79
79
}
80
80
81
81
if (uart_irq_tx_ready (dev )) {
82
- len = ring_buf_get (& p -> tx_buf , buf , 1 );
82
+ len = ring_buffer_read (& p -> tx_buf , buf , 1 );
83
83
if (!len ) {
84
84
uart_irq_tx_disable (dev );
85
85
} else {
@@ -99,15 +99,15 @@ static int osdp_uart_receive(void *data, uint8_t *buf, int len)
99
99
{
100
100
struct osdp_device * p = data ;
101
101
102
- return (int )ring_buf_get (& p -> rx_buf , buf , len );
102
+ return (int )ring_buffer_read (& p -> rx_buf , buf , len );
103
103
}
104
104
105
105
static int osdp_uart_send (void * data , uint8_t * buf , int len )
106
106
{
107
107
int sent = 0 ;
108
108
struct osdp_device * p = data ;
109
109
110
- sent = (int )ring_buf_put (& p -> tx_buf , buf , len );
110
+ sent = (int )ring_buffer_write (& p -> tx_buf , buf , len );
111
111
uart_irq_tx_enable (p -> dev );
112
112
return sent ;
113
113
}
@@ -117,8 +117,8 @@ static void osdp_uart_flush(void *data)
117
117
struct osdp_device * p = data ;
118
118
119
119
p -> wait_for_mark = 1 ;
120
- ring_buf_reset (& p -> tx_buf );
121
- ring_buf_reset (& p -> rx_buf );
120
+ ring_buffer_reset (& p -> tx_buf );
121
+ ring_buffer_reset (& p -> rx_buf );
122
122
}
123
123
124
124
struct osdp * osdp_get_ctx ()
@@ -193,8 +193,8 @@ static int osdp_init(void)
193
193
k_fifo_init (& p -> rx_event_fifo );
194
194
#endif
195
195
196
- ring_buf_init (& p -> rx_buf , sizeof ( p -> rx_fbuf ), p -> rx_fbuf );
197
- ring_buf_init (& p -> tx_buf , sizeof ( p -> tx_fbuf ), p -> tx_fbuf );
196
+ ring_buffer_init (& p -> rx_buf , p -> rx_fbuf , sizeof ( p -> rx_fbuf ) );
197
+ ring_buffer_init (& p -> tx_buf , p -> tx_fbuf , sizeof ( p -> tx_fbuf ) );
198
198
199
199
/* init OSDP uart device */
200
200
p -> dev = DEVICE_DT_GET (DT_CHOSEN (zephyr_osdp_uart ));
0 commit comments