This commit is contained in:
李昂 2023-01-18 12:36:40 +08:00
commit fb903d0c5f
18 changed files with 861 additions and 516 deletions

View File

@ -1,38 +0,0 @@
from PikaObj import *
import PikaStdDevice
class GPIO(PikaStdDevice.GPIO):
# override
def platformHigh():
pass
# override
def platformLow():
pass
# override
def platformEnable():
pass
# override
def platformDisable():
pass
# override
def platformSetMode():
pass
# override
def platformRead():
pass
class Time(PikaStdDevice.Time):
# override
def sleep_s(s: int):
pass
# override
def sleep_ms(ms: int):
pass

View File

@ -1,106 +0,0 @@
#include <stdint.h>
#include "BaseObj.h"
#include "ESP32_common.h"
#include "dataStrs.h"
void ESP32_GPIO_platformDisable(PikaObj *self)
{
char *pin = obj_getStr(self, "pin");
int gpioPort = getGpioPin(pin);
if (-1 == gpioPort)
{
obj_setErrorCode(self, 1);
obj_setSysOut(self, "[error] not match gpio pin.");
return;
}
gpio_reset_pin(gpioPort);
}
void ESP32_GPIO_platformEnable(PikaObj *self)
{
char *pin = obj_getStr(self, "pin");
char *mode = obj_getStr(self, "mode");
int gpioPort = getGpioPin(pin);
if (-1 == gpioPort)
{
obj_setErrorCode(self, 1);
obj_setSysOut(self, "[error] not match gpio pin.");
return;
}
uint32_t pinMode = getPinMode(mode);
uint8_t gpioPullUp = 0;
uint8_t gpioPullDown = 0;
char *pull = obj_getStr(self, "pull");
if (strEqu(pull, "up"))
{
gpioPullUp = 1;
}
else if (strEqu(pull, "down"))
{
gpioPullDown = 1;
}
gpio_config_t io_conf = {};
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = pinMode;
io_conf.pin_bit_mask = 1 << gpioPort;
io_conf.pull_down_en = gpioPullDown;
io_conf.pull_up_en = gpioPullUp;
gpio_config(&io_conf);
}
void ESP32_GPIO_platformHigh(PikaObj *self)
{
char *pin = obj_getStr(self, "pin");
int gpioPort = getGpioPin(pin);
if (-1 == gpioPort)
{
obj_setErrorCode(self, 1);
obj_setSysOut(self, "[error] not match gpio pin.");
return;
}
gpio_set_level(gpioPort, 1);
}
void ESP32_GPIO_platformLow(PikaObj *self)
{
char *pin = obj_getStr(self, "pin");
int gpioPort = getGpioPin(pin);
if (-1 == gpioPort)
{
obj_setErrorCode(self, 1);
obj_setSysOut(self, "[error] not match gpio pin.");
return;
}
gpio_set_level(gpioPort, 0);
}
void ESP32_GPIO_platformRead(PikaObj *self)
{
char *pin = obj_getStr(self, "pin");
int gpioPort = getGpioPin(pin);
if (-1 == gpioPort)
{
obj_setErrorCode(self, 1);
obj_setSysOut(self, "[error] not match gpio port.");
return;
}
obj_setInt(self, "readBuff", gpio_get_level(gpioPort));
}
void ESP32_GPIO_platformSetMode(PikaObj *self)
{
char *pin = obj_getStr(self, "pin");
char* mode = obj_getStr(self, "mode");
int gpioPort = getGpioPin(pin);
if (-1 == gpioPort)
{
obj_setErrorCode(self, 1);
obj_setSysOut(self, "[error] not match gpio port.");
return;
}
uint32_t pinMode = getPinMode(mode);
gpio_set_direction(gpioPort, pinMode);
}

View File

@ -1,15 +0,0 @@
#include <stdint.h>
#include "BaseObj.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "ESP32_common.h"
void ESP32_Time_sleep_ms(PikaObj *self, int ms)
{
vTaskDelay(pdMS_TO_TICKS(ms));
}
void ESP32_Time_sleep_s(PikaObj *self, int s)
{
vTaskDelay(pdMS_TO_TICKS(1000 * s));
}

View File

@ -1,27 +0,0 @@
#include "ESP32_common.h"
#include "dataStrs.h"
int getGpioPin(char *pin)
{
int num = -1;
sscanf(pin, "P%d\n", &num);
return num;
}
uint32_t getPinMode(char *mode)
{
if (strEqu(mode, "out"))
{
return GPIO_MODE_OUTPUT;
}
else if (strEqu(mode, "in"))
{
return GPIO_MODE_INPUT;
}
else if (strEqu(mode, "out_od"))
{
return GPIO_MODE_OUTPUT_OD;
}
return GPIO_MODE_DISABLE;
}

View File

@ -0,0 +1,133 @@
#include <stdint.h>
#include "BaseObj.h"
#include "dataStrs.h"
#include "driver/gpio.h"
#include "pika_hal_ESP32_common.h"
int pika_hal_platform_GPIO_open(pika_dev* dev, char* name) {
platform_data_GPIO* gpio =
(platform_data_GPIO*)pikaMalloc(sizeof(platform_data_GPIO));
if (NULL == gpio) {
return -1;
}
memset(gpio, 0, sizeof(platform_data_GPIO));
gpio->gpioPort = getGpioPin(name);
if (-1 == gpio->gpioPort) {
pikaFree(gpio, sizeof(platform_data_GPIO));
return -1;
}
dev->platform_data = gpio;
return 0;
}
int pika_hal_platform_GPIO_close(pika_dev* dev) {
platform_data_GPIO* gpio = (platform_data_GPIO*)dev->platform_data;
if (NULL == gpio) {
return -1;
}
pikaFree(gpio, sizeof(platform_data_GPIO));
dev->platform_data = NULL;
return 0;
}
int pika_hal_platform_GPIO_read(pika_dev* dev, void* buf, size_t count) {
platform_data_GPIO* gpio = (platform_data_GPIO*)dev->platform_data;
if (NULL == gpio) {
return -1;
}
*((uint32_t*)buf) = (uint32_t)gpio_get_level(gpio->gpioPort);
return 0;
}
int pika_hal_platform_GPIO_write(pika_dev* dev, void* buf, size_t count) {
platform_data_GPIO* gpio = (platform_data_GPIO*)dev->platform_data;
if (NULL == gpio) {
return -1;
}
gpio_set_level(gpio->gpioPort, *((uint32_t*)buf));
return 0;
}
int pika_hal_platform_GPIO_ioctl_enable(pika_dev* dev) {
platform_data_GPIO* gpio = (platform_data_GPIO*)dev->platform_data;
if (NULL == gpio) {
return -1;
}
gpio_config(&gpio->io_conf);
return 0;
}
int pika_hal_platform_GPIO_ioctl_disable(pika_dev* dev) {
platform_data_GPIO* gpio = (platform_data_GPIO*)dev->platform_data;
if (NULL == gpio) {
return -1;
}
gpio_reset_pin(gpio->gpioPort);
return 0;
}
int pika_hal_platform_GPIO_ioctl_config(pika_dev* dev,
pika_hal_GPIO_config* cfg) {
platform_data_GPIO* gpio = (platform_data_GPIO*)dev->platform_data;
if (NULL == gpio) {
return -1;
}
if (!dev->is_enabled) {
/* init config */
gpio->io_conf.intr_type = GPIO_INTR_DISABLE;
switch (cfg->dir) {
case PIKA_HAL_GPIO_DIR_IN:
gpio->io_conf.mode = GPIO_MODE_INPUT;
break;
case PIKA_HAL_GPIO_DIR_OUT:
gpio->io_conf.mode = GPIO_MODE_OUTPUT;
break;
default:
return -1;
}
gpio->io_conf.pin_bit_mask = 1 << gpio->gpioPort;
switch (cfg->pull) {
case PIKA_HAL_GPIO_PULL_UP:
gpio->io_conf.pull_up_en = 1;
gpio->io_conf.pull_down_en = 0;
break;
case PIKA_HAL_GPIO_PULL_DOWN:
gpio->io_conf.pull_up_en = 0;
gpio->io_conf.pull_down_en = 1;
break;
case PIKA_HAL_GPIO_PULL_NONE:
gpio->io_conf.pull_up_en = 0;
gpio->io_conf.pull_down_en = 0;
break;
default:
return -1;
}
}
if (dev->is_enabled) {
/* config after init */
switch (cfg->dir) {
case PIKA_HAL_GPIO_DIR_IN:
gpio_set_direction(gpio->gpioPort, GPIO_MODE_INPUT);
break;
case PIKA_HAL_GPIO_DIR_OUT:
gpio_set_direction(gpio->gpioPort, GPIO_MODE_OUTPUT);
break;
default:
return -1;
}
switch (cfg->pull) {
case PIKA_HAL_GPIO_PULL_UP:
gpio_set_pull_mode(gpio->gpioPort, GPIO_PULLUP_ONLY);
break;
case PIKA_HAL_GPIO_PULL_DOWN:
gpio_set_pull_mode(gpio->gpioPort, GPIO_PULLDOWN_ONLY);
break;
case PIKA_HAL_GPIO_PULL_NONE:
gpio_set_pull_mode(gpio->gpioPort, GPIO_FLOATING);
break;
default:
return -1;
}
}
return 0;
}

View File

@ -0,0 +1,248 @@
#include <stdint.h>
#include "BaseObj.h"
#include "dataStrs.h"
#include "driver/uart.h"
#include "pika_hal_ESP32_common.h"
typedef struct platform_data_UART {
uart_port_t uartPort;
uart_config_t uart_conf;
QueueHandle_t uart_queue;
gpio_num_t tx_port;
gpio_num_t rx_port;
gpio_num_t rts_port;
gpio_num_t cts_port;
} platform_data_UART;
int pika_hal_platform_UART_open(pika_dev* dev, char* name) {
/* UARTX */
if (name[0] != 'U' || name[1] != 'A' || name[2] != 'R' || name[3] != 'T') {
return -1;
}
platform_data_UART* uart = pikaMalloc(sizeof(platform_data_UART));
memset(uart, 0, sizeof(platform_data_UART));
uart->uartPort = fast_atoi(name + 4);
if (uart->uartPort < 0 || uart->uartPort >= UART_NUM_MAX) {
pikaFree(uart, sizeof(platform_data_UART));
return -1;
}
dev->platform_data = uart;
return 0;
}
int pika_hal_platform_UART_close(pika_dev* dev) {
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
if (NULL == uart) {
return -1;
}
pikaFree(uart, sizeof(platform_data_UART));
dev->platform_data = NULL;
return 0;
}
int pika_hal_platform_UART_read(pika_dev* dev, void* buf, size_t count) {
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
if (NULL == uart) {
return -1;
}
return uart_read_bytes(uart->uartPort, buf, count, 100);
}
int pika_hal_platform_UART_write(pika_dev* dev, void* buf, size_t count) {
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
if (NULL == uart) {
return -1;
}
return uart_write_bytes(uart->uartPort, buf, count);
}
static void uart_event_task(void* pvParameters) {
pika_dev* dev = (pika_dev*)pvParameters;
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
pika_hal_UART_config* cfg = (pika_hal_UART_config*)dev->ioctl_config;
if (NULL == uart) {
pika_platform_printf("Error: uart_event_task: uart is NULL\r\n");
vTaskDelete(NULL);
return;
}
uart_event_t event;
for (;;) {
// Waiting for UART event.
if (xQueueReceive(uart->uart_queue, (void*)&event,
(TickType_t)portMAX_DELAY)) {
pika_debug("UART%d: event.type: %d\r\n", uart->uartPort,
event.type);
switch (event.type) {
// Event of UART receving data
/*We'd better handler data event fast, there would be much more
data events than other types of events. If we take too much time
on data event, the queue might be full.*/
case UART_DATA:
cfg->event_callback(dev, event.type);
break;
// Others
default:
break;
}
}
}
vTaskDelete(NULL);
}
int pika_hal_platform_UART_ioctl_enable(pika_dev* dev) {
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
pika_debug("UART%d_enable: platform_data: %p\r\n", uart->uartPort, uart);
pika_hal_UART_config* cfg = (pika_hal_UART_config*)dev->ioctl_config;
if (NULL == uart || NULL == cfg) {
return -1;
}
uart_driver_install(uart->uartPort, 1024, 1024, 20, &uart->uart_queue, 0);
pika_debug(
"UART%d: baudrate:%d, data_bits:%d, parity:%d, stop_bits: %d\r\n",
uart->uartPort, uart->uart_conf.baud_rate, uart->uart_conf.data_bits,
uart->uart_conf.parity, uart->uart_conf.stop_bits);
uart_param_config(uart->uartPort, &uart->uart_conf);
pika_debug("UART%d: tx:%d, rx:%d, rts:%d, cts:%d\r\n", uart->uartPort,
uart->tx_port, uart->rx_port, uart->rts_port, uart->cts_port);
uart_set_pin(uart->uartPort, uart->tx_port, uart->rx_port, uart->rts_port,
uart->cts_port);
return 0;
}
int pika_hal_platform_UART_ioctl_disable(pika_dev* dev) {
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
if (NULL == uart) {
return -1;
}
uart_driver_delete(uart->uartPort);
return 0;
}
int pika_hal_platform_UART_ioctl_config(pika_dev* dev,
pika_hal_UART_config* cfg) {
platform_data_UART* uart = (platform_data_UART*)dev->platform_data;
pika_debug("UART%d_config: platform_data: %p\r\n", uart->uartPort, uart);
if (NULL == uart || NULL == cfg) {
pika_platform_printf("Error: uart config error, uart:%p, cfg:%p\r\n",
uart, cfg);
return -1;
}
uart->uart_conf.baud_rate = cfg->baudrate;
pika_debug("UART%d: set baudrate to %d\r\n", uart->uartPort,
uart->uart_conf.baud_rate);
switch (cfg->data_bits) {
case PIKA_HAL_UART_DATA_BITS_5:
uart->uart_conf.data_bits = UART_DATA_5_BITS;
break;
case PIKA_HAL_UART_DATA_BITS_6:
uart->uart_conf.data_bits = UART_DATA_6_BITS;
break;
case PIKA_HAL_UART_DATA_BITS_7:
uart->uart_conf.data_bits = UART_DATA_7_BITS;
break;
case PIKA_HAL_UART_DATA_BITS_8:
uart->uart_conf.data_bits = UART_DATA_8_BITS;
break;
default:
uart->uart_conf.data_bits = UART_DATA_8_BITS;
break;
}
pika_debug("UART%d: set data_bites to %d\r\n", uart->uartPort,
uart->uart_conf.data_bits);
switch (cfg->parity) {
case PIKA_HAL_UART_PARITY_NONE:
uart->uart_conf.parity = UART_PARITY_DISABLE;
break;
case PIKA_HAL_UART_PARITY_ODD:
uart->uart_conf.parity = UART_PARITY_ODD;
break;
case PIKA_HAL_UART_PARITY_EVEN:
uart->uart_conf.parity = UART_PARITY_EVEN;
break;
default:
uart->uart_conf.parity = UART_PARITY_DISABLE;
break;
}
pika_debug("UART%d: set parity to %d\r\n", uart->uartPort,
uart->uart_conf.parity);
switch (cfg->stop_bits) {
case PIKA_HAL_UART_STOP_BITS_1:
uart->uart_conf.stop_bits = UART_STOP_BITS_1;
break;
case PIKA_HAL_UART_STOP_BITS_1_5:
uart->uart_conf.stop_bits = UART_STOP_BITS_1_5;
break;
case PIKA_HAL_UART_STOP_BITS_2:
uart->uart_conf.stop_bits = UART_STOP_BITS_2;
break;
default:
uart->uart_conf.stop_bits = UART_STOP_BITS_1;
break;
}
pika_debug("UART%d: set stop_bits to %d\r\n", uart->uartPort,
uart->uart_conf.stop_bits);
switch (cfg->flow_control) {
case PIKA_HAL_UART_FLOW_CONTROL_NONE:
uart->uart_conf.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
break;
case PIKA_HAL_UART_FLOW_CONTROL_RTS:
uart->uart_conf.flow_ctrl = UART_HW_FLOWCTRL_RTS;
break;
case PIKA_HAL_UART_FLOW_CONTROL_CTS:
uart->uart_conf.flow_ctrl = UART_HW_FLOWCTRL_CTS;
break;
case PIKA_HAL_UART_FLOW_CONTROL_RTS_CTS:
uart->uart_conf.flow_ctrl = UART_HW_FLOWCTRL_CTS_RTS;
break;
default:
uart->uart_conf.flow_ctrl = UART_HW_FLOWCTRL_DISABLE;
break;
}
uart->uart_conf.source_clk = UART_SCLK_DEFAULT;
pika_debug("UART%d: set flow_control to %d\r\n", uart->uartPort,
uart->uart_conf.flow_ctrl);
if (NULL == cfg->TX || NULL == cfg->RX) {
pika_platform_printf("Error: uart config error, TX:%p, RX:%p\r\n",
cfg->TX, cfg->RX);
return -1;
}
uart->tx_port = ((platform_data_GPIO*)(cfg->TX->platform_data))->gpioPort;
uart->rx_port = ((platform_data_GPIO*)(cfg->RX->platform_data))->gpioPort;
if (NULL != cfg->RTS && NULL != cfg->CTS) {
uart->rts_port =
((platform_data_GPIO*)(cfg->RTS->platform_data))->gpioPort;
uart->cts_port =
((platform_data_GPIO*)(cfg->CTS->platform_data))->gpioPort;
} else {
uart->rts_port = UART_PIN_NO_CHANGE;
uart->cts_port = UART_PIN_NO_CHANGE;
}
/* support event callback */
if (dev->is_enabled == PIKA_TRUE && NULL != cfg->event_callback &&
PIKA_HAL_EVENT_CALLBACK_ENA_ENABLE == cfg->event_callback_ena) {
// hosal_uart_ioctl(platform_uart, HOSAL_UART_MODE_SET,
// (void*)HOSAL_UART_MODE_INT);
switch (cfg->event_callback_filter) {
/* Configure UART to interrupt mode */
case PIKA_HAL_UART_EVENT_SIGNAL_RX:
pika_debug("Setting UART_RX callback\r\n");
uart_enable_rx_intr(uart->uartPort);
break;
case PIKA_HAL_UART_EVENT_SIGNAL_TX:
pika_debug("Setting UART_TX callback\r\n");
uart_enable_tx_intr(uart->uartPort, 1, 0);
break;
default:
__platform_printf(
"Error: not supported event callback filter %d\r\n",
cfg->event_callback_filter);
return -1;
}
/* start irq task thread */
xTaskCreate(uart_event_task, "uart_event_task", 8192, dev, 12, NULL);
}
return 0;
}

View File

@ -0,0 +1,32 @@
#include "pika_hal_ESP32_common.h"
#include "PikaObj.h"
#include "dataStrs.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
int getGpioPin(char* pin) {
int num = -1;
sscanf(pin, "P%d\n", &num);
return num;
}
uint32_t getPinMode(char* mode) {
if (strEqu(mode, "out")) {
return GPIO_MODE_OUTPUT;
} else if (strEqu(mode, "in")) {
return GPIO_MODE_INPUT;
} else if (strEqu(mode, "out_od")) {
return GPIO_MODE_OUTPUT_OD;
}
return GPIO_MODE_DISABLE;
}
void pika_platform_sleep_ms(uint32_t ms) {
vTaskDelay(pdMS_TO_TICKS(ms));
}
void pika_platform_sleep_s(uint32_t s) {
vTaskDelay(pdMS_TO_TICKS(1000 * s));
}

View File

@ -1,20 +1,22 @@
#ifndef __STM32__COMMON__H #ifndef __STM32__COMMON__H
#define __STM32__COMMON__H #define __STM32__COMMON__H
#include "PikaObj.h"
#include <stdint.h> #include <stdint.h>
#include "PikaObj.h"
#include "../PikaStdDevice/pika_hal.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "driver/uart.h"
// #if CONFIG_IDF_TARGET_ESP32 // #if CONFIG_IDF_TARGET_ESP32
// #endif // #endif
typedef struct platform_data_GPIO {
gpio_num_t gpioPort;
gpio_config_t io_conf;
} platform_data_GPIO;
int getGpioPin(char* pin); int getGpioPin(char* pin);
uint32_t getPinMode(char* mode); uint32_t getPinMode(char* mode);
#endif #endif

View File

@ -68,6 +68,7 @@ class GPIO(BaseDev):
def read(self) -> int: def read(self) -> int:
"""Read the pin value.""" """Read the pin value."""
SIGNAL_RISING: int SIGNAL_RISING: int
SIGNAL_FALLING: int SIGNAL_FALLING: int
SIGNAL_ANY: int SIGNAL_ANY: int
@ -188,6 +189,26 @@ class UART:
def readBytes(self, length: int) -> bytes: def readBytes(self, length: int) -> bytes:
"""Read bytes from the UART.""" """Read bytes from the UART."""
def setPinTX(self, pin: str):
"""
Remap the TX pin.
"""
def setPinRX(self, pin: str):
"""
Remap the RX pin.
"""
def setPinCTS(self, pin: str):
"""
Remap the CTS pin.
"""
def setPinRTS(self, pin: str):
"""
Remap the RTS pin.
"""
def close(self): ... def close(self): ...
SIGNAL_RX: int SIGNAL_RX: int

View File

@ -24,6 +24,10 @@ void PikaStdDevice_UART_init(PikaObj* self) {
obj_setInt(self, "id", 1); obj_setInt(self, "id", 1);
obj_setStr(self, "readBuff", ""); obj_setStr(self, "readBuff", "");
obj_setInt(self, "flowControl", PIKA_HAL_UART_FLOW_CONTROL_NONE); obj_setInt(self, "flowControl", PIKA_HAL_UART_FLOW_CONTROL_NONE);
obj_setStr(self, "TXpin", "none");
obj_setStr(self, "RXpin", "none");
obj_setStr(self, "RTSpin", "none");
obj_setStr(self, "CTSpin", "none");
} }
void PikaStdDevice_UART___init__(PikaObj* self) { void PikaStdDevice_UART___init__(PikaObj* self) {
@ -84,14 +88,53 @@ void PikaStdDevice_UART_platformEnable(PikaObj* self) {
pika_dev* dev = _get_dev(self); pika_dev* dev = _get_dev(self);
if (NULL == dev) { if (NULL == dev) {
__platform_printf("Error: open UART '%d' failed.\r\n", __platform_printf("Error: open UART '%d' failed.\r\n",
obj_getInt(self, "id")); (int)obj_getInt(self, "id"));
return; return;
} }
pika_hal_UART_config cfg = {0}; pika_hal_UART_config cfg = {0};
cfg.baudrate = obj_getInt(self, "baudRate"); cfg.baudrate = obj_getInt(self, "baudRate");
cfg.flow_control = obj_getInt(self, "flowControl"); cfg.flow_control = obj_getInt(self, "flowControl");
pika_hal_ioctl(dev, PIKA_HAL_IOCTL_CONFIG, &cfg); if (!strEqu(obj_getStr(self, "TXpin"), "none")) {
pika_hal_ioctl(dev, PIKA_HAL_IOCTL_ENABLE); cfg.TX = pika_hal_open(PIKA_HAL_GPIO, obj_getStr(self, "TXpin"));
if (NULL == cfg.TX) {
__platform_printf("Error: open GPIO '%s' failed.\r\n",
obj_getStr(self, "TXpin"));
}
}
if (!strEqu(obj_getStr(self, "RXpin"), "none")) {
cfg.RX = pika_hal_open(PIKA_HAL_GPIO, obj_getStr(self, "RXpin"));
if (NULL == cfg.RX) {
__platform_printf("Error: open GPIO '%s' failed.\r\n",
obj_getStr(self, "RXpin"));
}
}
if (!strEqu(obj_getStr(self, "RTSpin"), "none")) {
cfg.RTS = pika_hal_open(PIKA_HAL_GPIO, obj_getStr(self, "RTSpin"));
if (NULL == cfg.RTS) {
__platform_printf("Error: open GPIO '%s' failed.\r\n",
obj_getStr(self, "RTSpin"));
}
}
if (!strEqu(obj_getStr(self, "CTSpin"), "none")) {
cfg.CTS = pika_hal_open(PIKA_HAL_GPIO, obj_getStr(self, "CTSpin"));
if (NULL == cfg.CTS) {
__platform_printf("Error: open GPIO '%s' failed.\r\n",
obj_getStr(self, "CTSpin"));
}
}
int err = -1;
err = pika_hal_ioctl(dev, PIKA_HAL_IOCTL_CONFIG, &cfg);
if (err != 0) {
__platform_printf("Error: config UART '%d' failed.\r\n",
(int)obj_getInt(self, "id"));
return;
}
err = pika_hal_ioctl(dev, PIKA_HAL_IOCTL_ENABLE);
if (err != 0) {
__platform_printf("Error: enable UART '%d' failed.\r\n",
(int)obj_getInt(self, "id"));
return;
}
} }
void PikaStdDevice_UART_platformRead(PikaObj* self) { void PikaStdDevice_UART_platformRead(PikaObj* self) {
@ -114,7 +157,7 @@ void PikaStdDevice_UART_platformDisable(PikaObj* self) {
pika_dev* dev = _get_dev(self); pika_dev* dev = _get_dev(self);
if (NULL == dev) { if (NULL == dev) {
__platform_printf("Error: open UART '%d' failed.\r\n", __platform_printf("Error: open UART '%d' failed.\r\n",
obj_getInt(self, "id")); (int)obj_getInt(self, "id"));
return; return;
} }
pika_hal_ioctl(dev, PIKA_HAL_IOCTL_DISABLE); pika_hal_ioctl(dev, PIKA_HAL_IOCTL_DISABLE);
@ -156,5 +199,38 @@ void PikaStdDevice_UART_setCallBack(PikaObj* self,
void PikaStdDevice_UART_close(PikaObj* self) { void PikaStdDevice_UART_close(PikaObj* self) {
pika_dev* dev = _get_dev(self); pika_dev* dev = _get_dev(self);
pika_hal_UART_config* cfg = (pika_hal_UART_config*)dev->ioctl_config;
if (NULL != cfg->TX) {
pika_hal_close(cfg->TX);
cfg->TX = NULL;
}
if (NULL != cfg->RX) {
pika_hal_close(cfg->RX);
cfg->RX = NULL;
}
if (NULL != cfg->RTS) {
pika_hal_close(cfg->RTS);
cfg->RTS = NULL;
}
if (NULL != cfg->CTS) {
pika_hal_close(cfg->CTS);
cfg->CTS = NULL;
}
pika_hal_close(dev); pika_hal_close(dev);
} }
void PikaStdDevice_UART_setPinCTS(PikaObj* self, char* pin) {
obj_setStr(self, "CTSpin", pin);
}
void PikaStdDevice_UART_setPinRTS(PikaObj* self, char* pin) {
obj_setStr(self, "RTSpin", pin);
}
void PikaStdDevice_UART_setPinRX(PikaObj* self, char* pin) {
obj_setStr(self, "RXpin", pin);
}
void PikaStdDevice_UART_setPinTX(PikaObj* self, char* pin) {
obj_setStr(self, "TXpin", pin);
}

View File

@ -26,6 +26,10 @@ static size_t _pika_hal_dev_config_size(PIKA_HAL_DEV_TYPE dev_type) {
} }
pika_dev* pika_hal_open(PIKA_HAL_DEV_TYPE dev_type, char* name) { pika_dev* pika_hal_open(PIKA_HAL_DEV_TYPE dev_type, char* name) {
if (NULL == name) {
__platform_printf("Error: dev_open name is NULL.\r\n");
return NULL;
}
int ret = -1; int ret = -1;
pika_dev* dev = NULL; pika_dev* dev = NULL;
if (dev_type >= _PIKA_DEV_TYPE_MAX) { if (dev_type >= _PIKA_DEV_TYPE_MAX) {
@ -203,6 +207,10 @@ int pika_hal_UART_ioctl_merge_config(pika_hal_UART_config* dst,
PIKA_HAL_UART_EVENT_SIGNAL_RX); PIKA_HAL_UART_EVENT_SIGNAL_RX);
_IOCTL_CONFIG_USE_DEFAULT(event_callback_ena, _IOCTL_CONFIG_USE_DEFAULT(event_callback_ena,
PIKA_HAL_EVENT_CALLBACK_ENA_ENABLE); PIKA_HAL_EVENT_CALLBACK_ENA_ENABLE);
_IOCTL_CONFIG_USE_DEFAULT(TX, NULL);
_IOCTL_CONFIG_USE_DEFAULT(RX, NULL);
_IOCTL_CONFIG_USE_DEFAULT(RTS, NULL);
_IOCTL_CONFIG_USE_DEFAULT(CTS, NULL);
return 0; return 0;
} }

View File

@ -138,6 +138,10 @@ typedef struct {
void (*event_callback)(pika_dev* dev, PIKA_HAL_UART_EVENT_SIGNAL signal); void (*event_callback)(pika_dev* dev, PIKA_HAL_UART_EVENT_SIGNAL signal);
PIKA_HAL_UART_EVENT_SIGNAL event_callback_filter; PIKA_HAL_UART_EVENT_SIGNAL event_callback_filter;
PIKA_HAL_EVENT_CALLBACK_ENA event_callback_ena; PIKA_HAL_EVENT_CALLBACK_ENA event_callback_ena;
pika_dev* TX;
pika_dev* RX;
pika_dev* RTS;
pika_dev* CTS;
} pika_hal_UART_config; } pika_hal_UART_config;
typedef uint32_t PIKA_HAL_IIC_SLAVE_ADDR; typedef uint32_t PIKA_HAL_IIC_SLAVE_ADDR;

View File

@ -76,7 +76,7 @@ releases = [
"v1.11.7 97b8268a31f195092a9ec1d848fbe49168c42c19", "v1.11.7 97b8268a31f195092a9ec1d848fbe49168c42c19",
"v1.11.8 1a66a70893702174294214d227aee3ec8e4498af", "v1.11.8 1a66a70893702174294214d227aee3ec8e4498af",
"v1.11.9 b2f397a990f0aa88129104d460174339531ee808", "v1.11.9 b2f397a990f0aa88129104d460174339531ee808",
"v1.12.0 47f5c0d129a7c843f968f92bd105f2ea5c6a6e24", "v1.12.0 a586c3f973cf38094353d254be46d8f61c5898ae"
] ]
[[packages]] [[packages]]
@ -145,7 +145,7 @@ releases = [
"v1.11.7 97b8268a31f195092a9ec1d848fbe49168c42c19", "v1.11.7 97b8268a31f195092a9ec1d848fbe49168c42c19",
"v1.11.8 1a66a70893702174294214d227aee3ec8e4498af", "v1.11.8 1a66a70893702174294214d227aee3ec8e4498af",
"v1.11.9 b2f397a990f0aa88129104d460174339531ee808", "v1.11.9 b2f397a990f0aa88129104d460174339531ee808",
"v1.12.0 47f5c0d129a7c843f968f92bd105f2ea5c6a6e24", "v1.12.0 a586c3f973cf38094353d254be46d8f61c5898ae"
] ]
[[packages]] [[packages]]
@ -180,6 +180,7 @@ releases = [
"v2.2.0 747fc1be13d57f920b436a2dbbfce253d8c3546f", "v2.2.0 747fc1be13d57f920b436a2dbbfce253d8c3546f",
"v2.2.1 e28d9ee48feaf2125c018e5a18db60f648f038f8", "v2.2.1 e28d9ee48feaf2125c018e5a18db60f648f038f8",
"v2.3.0 6f8c27087178609c39cbd1ce14f655df0415e4b0", "v2.3.0 6f8c27087178609c39cbd1ce14f655df0415e4b0",
"v2.3.1 3ecb76f3a27963e12f62dd5e71e2d313b1ec2c8c"
] ]
[[packages]] [[packages]]
@ -188,7 +189,7 @@ releases = [
"v0.0.1 31146e2395e80b5785a4b2e526913a4590160e66", "v0.0.1 31146e2395e80b5785a4b2e526913a4590160e66",
"v0.1.0 793634882044af25f30bb59c6511c615e56f85c5", "v0.1.0 793634882044af25f30bb59c6511c615e56f85c5",
"v0.2.0 211569c5a0169dbb700885d21fbbe0c678126e9e", "v0.2.0 211569c5a0169dbb700885d21fbbe0c678126e9e",
"v0.2.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.2.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
@ -196,35 +197,35 @@ name = "PikaCV"
releases = [ releases = [
"v0.0.1 b463e812bf0334b55835a3b31cda0c2f6c526e06", "v0.0.1 b463e812bf0334b55835a3b31cda0c2f6c526e06",
"v0.1.0 211569c5a0169dbb700885d21fbbe0c678126e9e", "v0.1.0 211569c5a0169dbb700885d21fbbe0c678126e9e",
"v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "unittest" name = "unittest"
releases = [ releases = [
"v0.1.0 cd6dfbbb714228e7e0f147515d58450644e7dadf", "v0.1.0 cd6dfbbb714228e7e0f147515d58450644e7dadf",
"v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "re" name = "re"
releases = [ releases = [
"v0.1.0 87da4d26d1ebf9525f66e9fe7acd5ea62f9b7f74", "v0.1.0 87da4d26d1ebf9525f66e9fe7acd5ea62f9b7f74",
"v0.1.1 728e9dce9ad2c47d5ac16165a583a794043a2e2b", "v0.1.1 728e9dce9ad2c47d5ac16165a583a794043a2e2b"
] ]
[[packages]] [[packages]]
name = "socket" name = "socket"
releases = [ releases = [
"v0.1.0 f09ea25237cd35a27fd071198ff771c8b4a088ad", "v0.1.0 f09ea25237cd35a27fd071198ff771c8b4a088ad",
"v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "random" name = "random"
releases = [ releases = [
"v0.1.0 7244267b6839b8af2238b6cdd9a73e4a3aebb347", "v0.1.0 7244267b6839b8af2238b6cdd9a73e4a3aebb347",
"v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
@ -232,7 +233,7 @@ name = "configparser"
releases = [ releases = [
"v0.1.0 d3a9f6e226bb9cfccbfc588cc465672cefea9e82", "v0.1.0 d3a9f6e226bb9cfccbfc588cc465672cefea9e82",
"v0.2.0 211569c5a0169dbb700885d21fbbe0c678126e9e", "v0.2.0 211569c5a0169dbb700885d21fbbe0c678126e9e",
"v0.2.1 5fa138c9c19a315d66d8e02fa5901479e30ca892", "v0.2.1 5fa138c9c19a315d66d8e02fa5901479e30ca892"
] ]
[[packages]] [[packages]]
@ -243,7 +244,7 @@ releases = [
"v1.0.0 cbde99793b1e631ab7f54775cba3f5372895b560", "v1.0.0 cbde99793b1e631ab7f54775cba3f5372895b560",
"v1.0.1 5148412411e2de0d23e9c5857b0b4843f479a5be", "v1.0.1 5148412411e2de0d23e9c5857b0b4843f479a5be",
"v1.1.0 211569c5a0169dbb700885d21fbbe0c678126e9e", "v1.1.0 211569c5a0169dbb700885d21fbbe0c678126e9e",
"v1.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v1.1.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
@ -258,7 +259,7 @@ releases = [
"v1.1.0 0cf260fca1e7613dc5523fd09de00df952c9dbd3", "v1.1.0 0cf260fca1e7613dc5523fd09de00df952c9dbd3",
"v1.1.1 68b28c780861190639452ed0642e2f4064fa44c3", "v1.1.1 68b28c780861190639452ed0642e2f4064fa44c3",
"v1.2.0 211569c5a0169dbb700885d21fbbe0c678126e9e", "v1.2.0 211569c5a0169dbb700885d21fbbe0c678126e9e",
"v1.2.1 4ed606173318d9d5e405b1fef03f217d1b7c8ccc", "v1.2.1 4ed606173318d9d5e405b1fef03f217d1b7c8ccc"
] ]
[[packages]] [[packages]]
@ -277,6 +278,7 @@ releases = [
"v0.4.0 e6a839810a5a98dd36a6436259a05ab3e9b8c6c0", "v0.4.0 e6a839810a5a98dd36a6436259a05ab3e9b8c6c0",
"v0.4.1 6f5c4bfae50fc5ae347609e58650f2d185171f9f", "v0.4.1 6f5c4bfae50fc5ae347609e58650f2d185171f9f",
"v0.4.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.4.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81",
"v0.4.3 312e708525fdb887ea39cc28652bbdae04675fc8"
] ]
[[packages]] [[packages]]
@ -291,14 +293,14 @@ releases = [
"v1.1.1 ac4247e5fd3e221eb110a1b41276849c623049ec", "v1.1.1 ac4247e5fd3e221eb110a1b41276849c623049ec",
"v1.2.0 e2e94bb3a349985641fa686341757cfbd18207e2", "v1.2.0 e2e94bb3a349985641fa686341757cfbd18207e2",
"v1.3.0 9f3a52558338503571b37c034a12219566f27aa2", "v1.3.0 9f3a52558338503571b37c034a12219566f27aa2",
"v1.3.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v1.3.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "PikaVSF" name = "PikaVSF"
releases = [ releases = [
"v0.0.1 f755ec10042f4deefef1c5491f5e91a651f71a1b", "v0.0.1 f755ec10042f4deefef1c5491f5e91a651f71a1b",
"v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
@ -316,7 +318,7 @@ releases = [
"v0.4.1 0892f1d426e3d69daaff1251d8e45d2ef60d1ad4", "v0.4.1 0892f1d426e3d69daaff1251d8e45d2ef60d1ad4",
"v0.5.0 c25d624cda5cc10bbdf803e1c343fc553e32477f", "v0.5.0 c25d624cda5cc10bbdf803e1c343fc553e32477f",
"v0.6.0 cbf1fdbea742957d59d3ec1486a1b39896105f19", "v0.6.0 cbf1fdbea742957d59d3ec1486a1b39896105f19",
"v0.6.1 2fa7916db1bb8f9afa957513a1ef5339d6581861", "v0.6.1 2fa7916db1bb8f9afa957513a1ef5339d6581861"
] ]
[[packages]] [[packages]]
@ -329,14 +331,14 @@ releases = [
"v0.0.1 fe900b79d8d1075bb7e4e3dd9d4e1e187e0c9195", "v0.0.1 fe900b79d8d1075bb7e4e3dd9d4e1e187e0c9195",
"v1.0.0 ac4247e5fd3e221eb110a1b41276849c623049ec", "v1.0.0 ac4247e5fd3e221eb110a1b41276849c623049ec",
"v1.0.1 61e6a7352b656adbce0f2ad82ea1fc992dcbb603", "v1.0.1 61e6a7352b656adbce0f2ad82ea1fc992dcbb603",
"v1.1.0 9f3a52558338503571b37c034a12219566f27aa2", "v1.1.0 9f3a52558338503571b37c034a12219566f27aa2"
] ]
[[packages]] [[packages]]
name = "TemplateDevice" name = "TemplateDevice"
releases = [ releases = [
"v0.0.1 281600804a5393c6721eab8ec6160a376ba010b4", "v0.0.1 281600804a5393c6721eab8ec6160a376ba010b4",
"v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
@ -352,7 +354,7 @@ releases = [
"v1.3.2 55164edbf2ab7e2e9e754663579e3c93040da8fa", "v1.3.2 55164edbf2ab7e2e9e754663579e3c93040da8fa",
"v1.4.0 4611a62ecf25c614b516ccef059f0933d822c26c", "v1.4.0 4611a62ecf25c614b516ccef059f0933d822c26c",
"v1.5.0 24c8f7644e81d37855472ae5bbe984e32bcf0190", "v1.5.0 24c8f7644e81d37855472ae5bbe984e32bcf0190",
"v2.0.0 4ec5e905587f474250c682b665f8105a2c4a4d30", "v2.0.0 4ec5e905587f474250c682b665f8105a2c4a4d30"
] ]
[[packages]] [[packages]]
@ -365,12 +367,15 @@ releases = [
"v1.1.0 186b951078c76b1c80b8111d76097970c21a3004", "v1.1.0 186b951078c76b1c80b8111d76097970c21a3004",
"v1.1.1 567d0b19ce998a290fa538845d107c744ccd0258", "v1.1.1 567d0b19ce998a290fa538845d107c744ccd0258",
"v1.1.2 55164edbf2ab7e2e9e754663579e3c93040da8fa", "v1.1.2 55164edbf2ab7e2e9e754663579e3c93040da8fa",
"v1.1.3 7a68bf910047fb055e5dbc0bdfdfec1366ca2469", "v1.1.3 7a68bf910047fb055e5dbc0bdfdfec1366ca2469"
] ]
[[packages]] [[packages]]
name = "ESP32" name = "ESP32"
releases = ["v0.1.0 ee7e38e9422970bba86f5cd7774db8654edd38dc"] releases = [
"v0.1.0 ee7e38e9422970bba86f5cd7774db8654edd38dc",
"v0.2.0 93591e92863f5e192dc89aed6666fd9dab4f7a82"
]
[[packages]] [[packages]]
name = "STM32F4" name = "STM32F4"
@ -379,7 +384,7 @@ releases = [
"v0.0.2 8bcb5ad868ec8961f2a3f08329a46ab0b780596b", "v0.0.2 8bcb5ad868ec8961f2a3f08329a46ab0b780596b",
"v0.1.0 ac05e34d026344d0590f562a55c142b6e0879933", "v0.1.0 ac05e34d026344d0590f562a55c142b6e0879933",
"v0.1.1 55164edbf2ab7e2e9e754663579e3c93040da8fa", "v0.1.1 55164edbf2ab7e2e9e754663579e3c93040da8fa",
"v0.1.2 27150fba49fd783536c2c6d0702f813604d3f0d8", "v0.1.2 27150fba49fd783536c2c6d0702f813604d3f0d8"
] ]
[[packages]] [[packages]]
@ -397,21 +402,21 @@ releases = [
"v1.1.3 f755ec10042f4deefef1c5491f5e91a651f71a1b", "v1.1.3 f755ec10042f4deefef1c5491f5e91a651f71a1b",
"v1.2.0 9f3a52558338503571b37c034a12219566f27aa2", "v1.2.0 9f3a52558338503571b37c034a12219566f27aa2",
"v1.3.0 9d7b155af3260c0fc00be05598c807b71d7cc198", "v1.3.0 9d7b155af3260c0fc00be05598c807b71d7cc198",
"v1.4.0 a567e7705f5049ec5bb44b4bcc7497666cb125b3", "v1.4.0 a567e7705f5049ec5bb44b4bcc7497666cb125b3"
] ]
[[packages]] [[packages]]
name = "CH32V103" name = "CH32V103"
releases = [ releases = [
"v1.0.0 4ce839297f208b0ac4fc1e7f16fef16ab605e70d", "v1.0.0 4ce839297f208b0ac4fc1e7f16fef16ab605e70d",
"v1.0.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v1.0.1 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "SmartLoong" name = "SmartLoong"
releases = [ releases = [
"v0.0.1 a5437de66e8cff600be247eae63ac9114b6b153f", "v0.0.1 a5437de66e8cff600be247eae63ac9114b6b153f",
"v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
@ -420,7 +425,7 @@ releases = [
"v0.0.1 88f4e507f1665ca7ceda149aabf029f4e21e22c7", "v0.0.1 88f4e507f1665ca7ceda149aabf029f4e21e22c7",
"v1.0.0 7ae9cd062fa48ecfe4b843c9f13b0daef0efd79d", "v1.0.0 7ae9cd062fa48ecfe4b843c9f13b0daef0efd79d",
"v1.1.0 c53bf1483d015555b4823f129864444198227403", "v1.1.0 c53bf1483d015555b4823f129864444198227403",
"v1.1.1 55164edbf2ab7e2e9e754663579e3c93040da8fa", "v1.1.1 55164edbf2ab7e2e9e754663579e3c93040da8fa"
] ]
[[packages]] [[packages]]
@ -429,7 +434,7 @@ releases = [
"v1.0.0 7cdb0cf9ed161c3fc6802028a9e34c9f94b56244", "v1.0.0 7cdb0cf9ed161c3fc6802028a9e34c9f94b56244",
"v1.1.0 bfc01e09fd71c26a7140d23864c1d3052f23d087", "v1.1.0 bfc01e09fd71c26a7140d23864c1d3052f23d087",
"v1.1.1 268c8433a1add8c902d694808682890a2df8c1fc", "v1.1.1 268c8433a1add8c902d694808682890a2df8c1fc",
"v1.1.2 55164edbf2ab7e2e9e754663579e3c93040da8fa", "v1.1.2 55164edbf2ab7e2e9e754663579e3c93040da8fa"
] ]
[[packages]] [[packages]]
@ -440,49 +445,49 @@ releases = ["v0.0.1 176232225939eccfaedfea412699a2e53c38ace1"]
name = "AIR32F1" name = "AIR32F1"
releases = [ releases = [
"v0.0.1 9f9579c54ebddb12c66afc8da64a987767ff512f", "v0.0.1 9f9579c54ebddb12c66afc8da64a987767ff512f",
"v0.1.0 faa9c6230149d09188114af7af822e5d34af6b55", "v0.1.0 faa9c6230149d09188114af7af822e5d34af6b55"
] ]
[[packages]] [[packages]]
name = "modbus" name = "modbus"
releases = [ releases = [
"v0.0.1 729ce8a497d73b53888180b9f6d0dfdac145df26", "v0.0.1 729ce8a497d73b53888180b9f6d0dfdac145df26",
"v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "pika_fatfs" name = "pika_fatfs"
releases = [ releases = [
"v0.0.1 280700b8a8eee1849d16ac68871d014392edf269", "v0.0.1 280700b8a8eee1849d16ac68871d014392edf269",
"v0.1.0 8ab8cd90be83f1cb86e2b2bcbb3b68d99d034815", "v0.1.0 8ab8cd90be83f1cb86e2b2bcbb3b68d99d034815"
] ]
[[packages]] [[packages]]
name = "mqtt" name = "mqtt"
releases = [ releases = [
"v0.0.1 04a174a7d3e02d8861124214f5a3551eaab2bfee", "v0.0.1 04a174a7d3e02d8861124214f5a3551eaab2bfee",
"v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81", "v0.0.2 ae13ede96f87b2dc9767b5e89c77dabf95c76e81"
] ]
[[packages]] [[packages]]
name = "requests" name = "requests"
releases = [ releases = [
"v0.0.1 04a174a7d3e02d8861124214f5a3551eaab2bfee", "v0.0.1 04a174a7d3e02d8861124214f5a3551eaab2bfee",
"v1.0.0 c67a894fc27ab3fe7b7aac825f1880e5073b0020", "v1.0.0 c67a894fc27ab3fe7b7aac825f1880e5073b0020"
] ]
[[packages]] [[packages]]
name = "hashlib" name = "hashlib"
releases = [ releases = [
"v1.0.0 ce05a5f03c4bfac536db60fe24f83705a1b58b02", "v1.0.0 ce05a5f03c4bfac536db60fe24f83705a1b58b02",
"v1.0.1 a91c3698abce8a6624929243cfb7cc79badaa156", "v1.0.1 a91c3698abce8a6624929243cfb7cc79badaa156"
] ]
[[packages]] [[packages]]
name = "hmac" name = "hmac"
releases = [ releases = [
"v1.0.0 ca8fe36d68be16722317860394fdf78c620e3e2d", "v1.0.0 ca8fe36d68be16722317860394fdf78c620e3e2d",
"v1.0.1 d75ce00c377e48c6058bbe1f824474802383e5e7", "v1.0.1 d75ce00c377e48c6058bbe1f824474802383e5e7"
] ]
[[packages]] [[packages]]
@ -492,7 +497,7 @@ releases = [
"v0.2.0 eee8e1848eed77f3ebed777230104ebb4dfc3263", "v0.2.0 eee8e1848eed77f3ebed777230104ebb4dfc3263",
"v0.3.0 fc69ce4145c053d0a5f9191e8706014c5bee4ca8", "v0.3.0 fc69ce4145c053d0a5f9191e8706014c5bee4ca8",
"v0.4.0 bcb2f3aac147cfb7b0f655b877d964e3fc0699c8", "v0.4.0 bcb2f3aac147cfb7b0f655b877d964e3fc0699c8",
"v0.4.1 e28d9ee48feaf2125c018e5a18db60f648f038f8", "v0.4.1 e28d9ee48feaf2125c018e5a18db60f648f038f8"
] ]
[[packages]] [[packages]]
@ -503,14 +508,14 @@ releases = ["v0.0.1 5c45cba0c39d447fbe7a4a082ee3170188c3bcb7"]
name = "base64" name = "base64"
releases = [ releases = [
"v0.0.1 1ae3ac23759fb2b5e0f77866af40986ac94e356d", "v0.0.1 1ae3ac23759fb2b5e0f77866af40986ac94e356d",
"v1.0.0 29ad2b44817c5a72ace9f6d09cea7df6beb516f9", "v1.0.0 29ad2b44817c5a72ace9f6d09cea7df6beb516f9"
] ]
[[packages]] [[packages]]
name = "pika_libc" name = "pika_libc"
releases = [ releases = [
"v1.0.0 42a3cebb085a4a995d80031685dbf630e053aa55", "v1.0.0 42a3cebb085a4a995d80031685dbf630e053aa55",
"v1.0.1 b77d20d7b2f5fd29ac3d55daeec65e77d15a9b72", "v1.0.1 b77d20d7b2f5fd29ac3d55daeec65e77d15a9b72"
] ]
[[packages]] [[packages]]

View File

@ -145,6 +145,8 @@ TEST(timetest, sleep) {
/* init */ /* init */
pikaMemInfo.heapUsedMax = 0; pikaMemInfo.heapUsedMax = 0;
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain); PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
extern unsigned char pikaModules_py_a[];
obj_linkLibrary(pikaMain, pikaModules_py_a);
/* run */ /* run */
__platform_printf("BEGIN\r\n"); __platform_printf("BEGIN\r\n");