From: Nathael Pajani Date: Mon, 10 Jul 2023 00:58:15 +0000 (+0200) Subject: Add uart number as parameter for scialys_uSD_append_data() X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=2579ec982eea6974b0196b058ec2c6783cc89e26;p=soft%2Flpc122x%2Fscialys Add uart number as parameter for scialys_uSD_append_data() --- diff --git a/v10/main.c b/v10/main.c index 336e892..c0791de 100644 --- a/v10/main.c +++ b/v10/main.c @@ -567,7 +567,7 @@ void store_data(uint32_t cur_tick) if (cur_tick > (last_tick_store + (NB_SEC_STORE * 1000))) { /* Divide by the number of values */ /* FIXME */ - scialys_uSD_append_data(&data); + scialys_uSD_append_data(UART0, &data); uprintf(UART0, "Saved 5s data\n"); nb_val = 0; last_tick_store = cur_tick; diff --git a/v10/uSD.c b/v10/uSD.c index f1ec9a7..34a5011 100644 --- a/v10/uSD.c +++ b/v10/uSD.c @@ -155,7 +155,7 @@ int scialys_uSD_logs_init(int uart) } /* Append data to temporary data buffer, and possibly flush data to uSD when buffer is full */ -int scialys_uSD_append_data(struct sd_data_blob* data) +int scialys_uSD_append_data(int uart, struct sd_data_blob* data) { static uint16_t index = 0; @@ -172,7 +172,7 @@ int scialys_uSD_append_data(struct sd_data_blob* data) if ((index + sizeof(struct sd_data_blob)) >= MMC_BUF_SIZE) { int ret = scialys_uSD_write(last_block.block_num + 1); if (ret != 0) { - uprintf(UART0, "Write to uSD returned %d\n", ret); + uprintf(uart, "Write to uSD returned %d\n", ret); /* Drop old data ... we do not have that much RAM available !!! */ index = 0; return ret; @@ -185,7 +185,7 @@ int scialys_uSD_append_data(struct sd_data_blob* data) /* FIXME */ } index = 0; - uprintf(UART0, "Wrote 512 bytes to SD card\n"); + uprintf(uart, "Wrote 512 bytes to SD card\n"); return 1; } diff --git a/v10/uSD.h b/v10/uSD.h index bb8fca3..670f1bd 100644 --- a/v10/uSD.h +++ b/v10/uSD.h @@ -71,7 +71,7 @@ int scialys_uSD_read(uint32_t block_num); int scialys_uSD_write(uint32_t block_num); /* Append data to temporary data buffer, and possibly flush data to uSD when buffer is full */ -int scialys_uSD_append_data(struct sd_data_blob* data); +int scialys_uSD_append_data(int uart, struct sd_data_blob* data); /* Check that the first part of a data buffer is a valid data block */ int scialys_uSD_data_buffer_is_valid(void);