Store the configuration on the SD card
This commit is contained in:
11
log.c
11
log.c
@@ -5,6 +5,7 @@
|
||||
#include "uart.h"
|
||||
#include "timer.h"
|
||||
#include "log.h"
|
||||
#include "config.h"
|
||||
|
||||
/* This is shared with sdcard.c */
|
||||
bool log_enabled;
|
||||
@@ -37,7 +38,9 @@ void log_put_byte(char c)
|
||||
* Better than overrunning.
|
||||
*/
|
||||
if (((log_bufferend + 1) % LOG_BUFFERSIZE) == log_bufferstart) {
|
||||
#if 0
|
||||
putstr("^");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
log_buffer[log_bufferend++] = c;
|
||||
@@ -70,6 +73,14 @@ void log_put_header(unsigned int timestamp)
|
||||
log_put_uint(log_read_busytime());
|
||||
}
|
||||
|
||||
void log_put_config(void)
|
||||
{
|
||||
log_put_uint(LOG_MAGIC_CONFIG);
|
||||
log_put_uint(CONFIG_VERSION);
|
||||
log_put_uint(sizeof(struct config));
|
||||
log_put_array((char *)&config, sizeof(struct config));
|
||||
}
|
||||
|
||||
void log_put_array(char *data, int length)
|
||||
{
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user