1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/openLuat-luatos-soc-air101

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
luat_rtc_air101.c 1 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
Wendal Chen Отправлено 2 лет назад fcdae84
#include "luat_rtc.h"
#include "luat_msgbus.h"
#include "wm_rtc.h"
#define LUAT_LOG_TAG "rtc"
#include "luat_log.h"
extern int Base_year;
static int luat_rtc_handler(lua_State *L, void* ptr) {
lua_getglobal(L, "sys_pub");
if (lua_isfunction(L, -1)) {
lua_pushstring(L, "RTC_IRQ");
lua_call(L, 1, 0);
}
return 0;
}
static void luat_rtc_cb(void *arg) {
//LLOGI("rtc irq");
rtos_msg_t msg;
msg.handler = luat_rtc_handler;
luat_msgbus_put(&msg, 0);
}
int luat_rtc_set(struct tm *tblock) {
if (tblock == NULL)
return -1;
tls_set_rtc(tblock);
return 0;
}
int luat_rtc_get(struct tm *tblock) {
if (tblock == NULL)
return -1;
tls_get_rtc(tblock);
return 0;
}
int luat_rtc_timer_start(int id, struct tm *tblock) {
if (id || tblock == NULL)
return -1;
tls_rtc_isr_register(luat_rtc_cb, NULL);
tls_rtc_timer_start(tblock);
return 0;
}
int luat_rtc_timer_stop(int id) {
if (id)
return -1;
tls_rtc_timer_stop();
return 0;
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/openLuat-luatos-soc-air101.git
git@gitlife.ru:oschina-mirror/openLuat-luatos-soc-air101.git
oschina-mirror
openLuat-luatos-soc-air101
openLuat-luatos-soc-air101
v0007.air101.v0015