first commit for chrg
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
|
||||
#include "shell.h"
|
||||
#include <board.h>
|
||||
#include <rtthread.h>
|
||||
#include <drv_gpio.h>
|
||||
#ifndef RT_USING_NANO
|
||||
#include <rtdevice.h>
|
||||
#endif /* RT_USING_NANO */
|
||||
|
||||
/* defined the LED0 pin: PC4 */
|
||||
/* LEDs: PC4, PA8, PC5, PA10 */
|
||||
#define LED0_PIN GET_PIN(A, 8)
|
||||
|
||||
void show_app_version (void)
|
||||
{
|
||||
rt_kprintf("\r\n\r\n============================================\r\n");
|
||||
rt_kprintf("\tcharger control via RT-Thread v%d.%d.%d\r\n",
|
||||
RT_VERSION_MAJOR, RT_VERSION_MINOR, RT_VERSION_PATCH);
|
||||
rt_kprintf("\tbuilt @ %s, %s\r\n", __DATE__, __TIME__);
|
||||
rt_kprintf("Chip UID: %08X - %08X - %08X\r\n",
|
||||
HAL_GetUIDw0(), HAL_GetUIDw1(), HAL_GetUIDw2());
|
||||
rt_kprintf("============================================\r\n");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
|
||||
finsh_set_prompt("chrg ");
|
||||
#endif
|
||||
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (1)
|
||||
{
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user