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;
}
/* 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;
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;
/* FIXME */
}
index = 0;
- uprintf(UART0, "Wrote 512 bytes to SD card\n");
+ uprintf(uart, "Wrote 512 bytes to SD card\n");
return 1;
}
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);