mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
26 lines
463 B
C
26 lines
463 B
C
#include "main.h"
|
|
#include "usart.h"
|
|
#include "gpio.h"
|
|
#include "pikaScript.h"
|
|
|
|
void Device_Uart_setName(PikaObj *self, char *name)
|
|
{
|
|
obj_setStr(self, "name", name);
|
|
}
|
|
|
|
void Device_Uart_send(PikaObj *self, char *data)
|
|
{
|
|
printf("[uart1]: %s\r\n", data);
|
|
}
|
|
|
|
void Device_Uart_printName(PikaObj *self)
|
|
{
|
|
char *name = obj_getStr(self, "name");
|
|
if (NULL == name)
|
|
{
|
|
printf("[error] Uart: can't find name.\r\n");
|
|
return;
|
|
}
|
|
|
|
printf("%s\r\n", name);
|
|
} |