42 #include <sys/types.h>
69 memset(file_dev, 0,
sizeof(*file_dev));
71 file_dev->
fh = fopen(filename, mode);
78 setbuf(file_dev->
fh, NULL);
80 *file_id = (uintptr_t) file_dev;
97 while (tx_bytes_avail > 0) {
98 bool tx_need_yield =
false;
103 len = fwrite(file_dev->
tx_buffer, 1, length, file_dev->
fh);
static void PIOS_FILEOUT_TxStart(uintptr_t udp_id, uint16_t tx_bytes_avail)
Main PiOS header to include all the compiled in PiOS options.
static pios_fileout_dev * find_file_dev_by_id(uintptr_t tcp)
#define PIOS_FILEOUT_TX_BUFFER_SIZE
void * PIOS_malloc(size_t size)
uint8_t tx_buffer[PIOS_FILEOUT_TX_BUFFER_SIZE]
static void PIOS_FILEOUT_RegisterTxCallback(uintptr_t udp_id, pios_com_callback tx_out_cb, uintptr_t context)
pios_com_callback tx_out_cb
int32_t PIOS_FILEOUT_Init(uintptr_t *file_id, const char *filename, const char *mode)
const struct pios_com_driver pios_fileout_com_driver
FILEOUT private definitions.
#define PIOS_Assert(test)
void(* tx_start)(uintptr_t id, uint16_t tx_bytes_avail)
uint16_t(* pios_com_callback)(uintptr_t context, uint8_t *buf, uint16_t buf_len, uint16_t *headroom, bool *task_woken)