initial commit
This commit is contained in:
29
hal/hal_watchdog/atbm6441/hal_interface_watchdog_atbm6441.c
Executable file
29
hal/hal_watchdog/atbm6441/hal_interface_watchdog_atbm6441.c
Executable file
@@ -0,0 +1,29 @@
|
||||
#include "hal_interface_watchdog.h"
|
||||
#include "hlog.h"
|
||||
|
||||
#define TAG "TAG_WATCHDOG"
|
||||
|
||||
#define WATCHDOG_INTERVAL ((uint32_t)(5000))
|
||||
|
||||
uint32_t hal_watchdog_init(){
|
||||
hlogd("%s", __func__);
|
||||
hal_watchdog_start();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t hal_watchdog_deinit(){
|
||||
hal_watchdog_stop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *hal_watchdog_kick(void *param){
|
||||
hlogd("%s %s", __func__, (char*)get_filename(__FILE__));
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t hal_watchdog_get_interval(){
|
||||
return WATCHDOG_INTERVAL;
|
||||
}
|
||||
|
||||
DECLARE_INIT(PRI_AFTER_DRIVER, hal_watchdog_init);
|
||||
|
||||
7
hal/hal_watchdog/config.mk
Executable file
7
hal/hal_watchdog/config.mk
Executable file
@@ -0,0 +1,7 @@
|
||||
SRC += $(wildcard $(HAL_DIR)/hal_watchdog/*.c)
|
||||
CFLAGS += -I$(HAL_DIR)/hal_watchdog
|
||||
ifdef MOD_WATCHDOG
|
||||
SRC += $(wildcard $(HAL_DIR)/hal_watchdog/$(MOD_WATCHDOG)/*.c)
|
||||
else
|
||||
$(warning warning you sure no audio?)
|
||||
endif
|
||||
21
hal/hal_watchdog/hal_interface_watchdog.c
Executable file
21
hal/hal_watchdog/hal_interface_watchdog.c
Executable file
@@ -0,0 +1,21 @@
|
||||
/*************************************************
|
||||
File name : hal_interface_watchdog.c
|
||||
Module :
|
||||
Author : amir
|
||||
Version : 0.1
|
||||
Created on : 2022-02-07
|
||||
Description :
|
||||
hal interface for watchdog
|
||||
|
||||
Modify History:
|
||||
1. Date: Author: Modification:
|
||||
*************************************************/
|
||||
#include "hal_interface_watchdog.h"
|
||||
|
||||
uint32_t hal_watchdog_start(){
|
||||
hal_timer_start(hal_watchdog_kick, NULL, hal_watchdog_get_interval());
|
||||
}
|
||||
|
||||
uint32_t hal_watchdog_stop(){
|
||||
hal_timer_stop(hal_watchdog_kick);
|
||||
}
|
||||
32
hal/hal_watchdog/hal_interface_watchdog.h
Executable file
32
hal/hal_watchdog/hal_interface_watchdog.h
Executable file
@@ -0,0 +1,32 @@
|
||||
#ifndef __HAL_INTERFACE_WATCHDOG_H__
|
||||
#define __HAL_INTERFACE_WATCHDOG_H__
|
||||
#include <stdint.h>
|
||||
#include "hal.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
uint32_t hal_watchdog_init();
|
||||
|
||||
uint32_t hal_watchdog_deinit();
|
||||
|
||||
uint32_t hal_watchdog_start();
|
||||
|
||||
uint32_t hal_watchdog_stop();
|
||||
|
||||
void *hal_watchdog_kick(void *param);
|
||||
|
||||
//return interval unit ms
|
||||
uint32_t hal_watchdog_get_interval();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user