|
|
5 months ago | |
|---|---|---|
| .. | ||
| .settings | 6 months ago | |
| board | 6 months ago | |
| figures | 1 year ago | |
| packages | 6 months ago | |
| rzn | 6 months ago | |
| rzn_cfg | 6 months ago | |
| rzn_gen | 6 months ago | |
| script | 6 months ago | |
| src | 1 year ago | |
| .api_xml | 1 year ago | |
| .config | 6 months ago | |
| .cproject | 6 months ago | |
| .gitignore | 1 year ago | |
| .project | 1 year ago | |
| .secure_azone | 1 year ago | |
| .secure_rzone | 6 months ago | |
| .secure_xml | 6 months ago | |
| Kconfig | 6 months ago | |
| README.md | 5 months ago | |
| README_zh.md | 5 months ago | |
| SConscript | 6 months ago | |
| SConstruct | 1 year ago | |
| buildinfo.ipcf | 6 months ago | |
| buildinfo.json | 6 months ago | |
| configuration.xml | 6 months ago | |
| envsetup.sh | 1 year ago | |
| mklinks.bat | 1 year ago | |
| mklinks.sh | 1 year ago | |
| ozone_scons.jdebug | 1 year ago | |
| project.ewd | 6 months ago | |
| project.ewp | 6 months ago | |
| project.ewt | 6 months ago | |
| project.eww | 1 year ago | |
| rtconfig.h | 6 months ago | |
| rtconfig.py | 1 year ago | |
| rzn_cfg.txt | 6 months ago | |
| template.ewd | 1 year ago | |
| template.ewp | 6 months ago | |
| template.eww | 1 year ago | |
English | Chinese
This example mainly introduces how to use the WDT (Watchdog Timer) device on the EtherKit.
None
Open the FSP tool and create a new stack, selecting r_wdt.
By performing a watchdog operation in the idle function, we ensure that our program runs as expected.
static void idle_hook(void)
{
/* 在空闲线程的回调函数里喂狗 */
rt_device_control(wdg_dev, RT_DEVICE_CTRL_WDT_KEEPALIVE, NULL);
rt_kprintf("feed the dog!\n ");
}
static int wdt_test(int argc, char *argv[])
{
rt_err_t ret = RT_EOK;
char device_name[RT_NAME_MAX];
/* 判断命令行参数是否给定了设备名称 */
if (argc == 2)
{
rt_strncpy(device_name, argv[1], RT_NAME_MAX);
}
}
RT-Thread Studio: Download the EtherKit resource package in the RT-Thread Studio package manager, then create a new project and compile it.
IAR: First, double-click mklinks.bat to generate links for the rt-thread and libraries folders; then use Env to generate the IAR project; finally, double-click project.eww to open the IAR project and compile it.
After compilation, connect the Jlink interface of the development board to the PC, and download the firmware to the development board.
None
Device and Driver: WDT Device