u8g2-copy/sys/sdl/clock/guihal.c

42 lines
491 B
C
Raw Normal View History

2017-05-01 17:24:03 +08:00
/*
guihal.c
*/
#include "gui.h"
#include <stdio.h>
/* 5x 32bit */
void store_gui_data(uint32_t *data)
{
FILE *fp;
fp = fopen("clock.dat", "w");
2017-05-02 03:23:59 +08:00
if ( fp != NULL )
{
fwrite(data, sizeof(uint32_t), 5, fp);
fclose(fp);
}
2017-05-01 17:24:03 +08:00
}
void load_gui_data(uint32_t *data)
{
FILE *fp;
2017-05-02 03:23:59 +08:00
int i;
for( i = 0; i < GUI_ALARM_CNT; i++ )
data[i] = 0;
2017-05-01 17:24:03 +08:00
fp = fopen("clock.dat", "r");
2017-05-02 03:23:59 +08:00
if ( fp != NULL )
{
fread(data, sizeof(uint32_t), 5, fp);
fclose(fp);
}
2017-05-01 17:24:03 +08:00
}