feat: 增加 vofa justfloat 发送
This commit is contained in:
15
app/by_vofa.c
Normal file
15
app/by_vofa.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "by_vofa.h"
|
||||
|
||||
void by_vofa_init(by_vofa_t *vofa, uart_index_enum uart_index, uint8_t param_num, float *param_ptr)
|
||||
{
|
||||
vofa->uart_index = uart_index;
|
||||
vofa->param_num = param_num;
|
||||
vofa->param_ptr = param_ptr;
|
||||
}
|
||||
|
||||
void by_vofa_send(by_vofa_t *vofa)
|
||||
{
|
||||
const uint8_t tail[4] = {0x00, 0x00, 0x80, 0x7F};
|
||||
uart_write_buffer(vofa->uart_index, (uint8_t *)vofa->param_ptr, vofa->param_num * 4);
|
||||
uart_write_buffer(vofa->uart_index, tail, 4);
|
||||
}
|
||||
Reference in New Issue
Block a user