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

103 lines
1.3 KiB
C
Raw Normal View History

2017-05-01 17:24:03 +08:00
/*
guihal.c
*/
#include "gui.h"
#include <stdio.h>
2017-05-06 02:59:46 +08:00
/*============================================*/
/* reset */
void do_reset(void)
{
}
2017-05-03 05:18:20 +08:00
/*============================================*/
/* load & store from/to permanent memory */
2017-05-01 17:24:03 +08:00
/* 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
}
2017-05-03 05:18:20 +08:00
/*============================================*/
/* input */
int is_por_reset(void)
{
return 1;
}
int is_button_reset(void)
{
return 0;
}
2017-05-09 04:08:16 +08:00
uint32_t get_boot_status_register(void)
{
return 0;
}
uint32_t get_pwr_status_register(void)
{
return 0;
}
2017-05-09 23:44:00 +08:00
uint32_t get_reset_reason(void)
{
return 0;
}
2017-05-09 04:08:16 +08:00
uint32_t get_wakeup_count(void)
{
return 0;
}
2017-05-03 05:18:20 +08:00
/*============================================*/
/* output */
void enable_alarm(void)
{
}
void disable_alarm(void)
{
}
2017-05-07 20:09:45 +08:00
void set_time(uint8_t ht, uint8_t ho, uint8_t mt, uint8_t mo, uint8_t st, uint8_t so)
{
}
void set_date(uint8_t yt, uint8_t yo, uint8_t mt, uint8_t mo, uint8_t dayt, uint8_t dayo, uint8_t weekday)
{
}