mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-17 15:38:14 +08:00
修复代码错误
This commit is contained in:
@@ -48,6 +48,8 @@ $(NAME)_SOURCES := ../../$(HOST_ARCH_M4)/crt0_$(TOOLCHAIN_NAME).c \
|
||||
|
||||
$(NAME)_CFLAGS += -Wno-implicit-function-declaration -Wno-unused-variable
|
||||
|
||||
# These need to be forced into the final ELF since they are not referenced otherwise
|
||||
$(NAME)_LINK_FILES := ../../$(HOST_ARCH_M4)/crt0_$(TOOLCHAIN_NAME).o
|
||||
|
||||
ifneq ($(filter $(subst ., ,$(COMPONENTS)),mocOS),)
|
||||
####################################################################################
|
||||
@@ -90,7 +92,9 @@ GLOBAL_INCLUDES += peripherals/boot2
|
||||
|
||||
GLOBAL_DEFINES += CONFIG_FLASH_PARTITION_COUNT=10 \
|
||||
ARM_GNU
|
||||
|
||||
|
||||
$(NAME)_LINK_FILES += ../../$(HOST_ARCH_M4)/hardfault_handler.o \
|
||||
platform_vector_table.o
|
||||
endif
|
||||
|
||||
ifneq ($(filter spi_flash_write, $(APP)),)
|
||||
|
||||
@@ -47,10 +47,6 @@ typedef struct _lwip_api_ {
|
||||
char *(*sethostname)( char *name );
|
||||
char* (*get_dhcp_classid)( void );
|
||||
char* (*set_dhcp_classid)( char *classid );
|
||||
|
||||
/* For inet_ntop and inet_pton */
|
||||
const char * (*inet_ntop) (int af, const void *cp, char *buf, socklen_t len);
|
||||
int (*inet_pton) (int af, const char *cp, void *buf);
|
||||
} lwip_api_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,11 +44,6 @@ void init_debug_uart(void)
|
||||
MicoUartInitialize(STDIO_UART, &stdio_uart_config,
|
||||
(ring_buffer_t*) &stdio_rx_buffer );
|
||||
}
|
||||
#else
|
||||
void init_debug_uart(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
mico_api_t *moc_adapter(new_mico_api_t *new_mico_api)
|
||||
@@ -266,8 +261,7 @@ mico_api_t *moc_adapter(new_mico_api_t *new_mico_api)
|
||||
mico_api.pwm_apis = _kernel_api.pwm_apis;
|
||||
mico_api.wdg_apis = _kernel_api.wdg_apis;
|
||||
mico_api.adc_apis = _kernel_api.adc_apis;
|
||||
mico_api.gtimer_apis = _kernel_api.gtimer_apis;
|
||||
|
||||
|
||||
return &mico_api;
|
||||
}
|
||||
|
||||
@@ -296,30 +290,3 @@ void autoconfig_start(int seconds, int mode)
|
||||
_kernel_api.wifi_apis->autoconfig_start(seconds, mode);
|
||||
}
|
||||
|
||||
void wlan_set_softap_tdma(int value)
|
||||
{
|
||||
_kernel_api.wifi_apis->wlan_set_softap_tdma(value);
|
||||
}
|
||||
|
||||
int wifi_off_fastly(void)
|
||||
{
|
||||
return _kernel_api.wifi_apis->wifi_off_fastly();
|
||||
}
|
||||
|
||||
int OpenEasylink_softap(int timeout, char *ssid, char*key, int channel)
|
||||
{
|
||||
return _kernel_api.wifi_apis->OpenEasylink_softap(timeout, ssid, key, channel);
|
||||
}
|
||||
|
||||
void ssl_set_ecc(int enable)
|
||||
{
|
||||
_kernel_api.ssl_crypto_apis->ssl_set_ecc(enable);
|
||||
}
|
||||
|
||||
/* return 1=success; 0=fail*/
|
||||
int disable_log_uart(void)
|
||||
{
|
||||
return _kernel_api.uart_apis->disable_log_uart();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -379,11 +379,6 @@ char *mico_get_bootloader_ver(void)
|
||||
return "bootloader";
|
||||
}
|
||||
|
||||
void MicoWakeupSource( uint8_t wakeup_source )
|
||||
{
|
||||
lib_api_p->pm_wakeup_source(wakeup_source);
|
||||
}
|
||||
|
||||
void MicoSystemStandBy( uint32_t secondsToWakeup )
|
||||
{
|
||||
lib_api_p->wifi_off_mcu_standby(secondsToWakeup);
|
||||
@@ -555,22 +550,6 @@ OSStatus MicoPwmStop(mico_pwm_t pwm)
|
||||
return lib_api_p->pwm_apis->pwm_stop(pwm);
|
||||
}
|
||||
|
||||
|
||||
OSStatus MicoGtimerInitialize(mico_gtimer_t gtimer)
|
||||
{
|
||||
return lib_api_p->gtimer_apis->MicoGtimerInitialize(gtimer);
|
||||
}
|
||||
|
||||
OSStatus MicoGtimerStart(mico_gtimer_t gtimer, mico_gtimer_mode_t mode, uint32_t time, mico_gtimer_irq_callback_t function, void *arg)
|
||||
{
|
||||
return lib_api_p->gtimer_apis->MicoGtimerStart(gtimer, mode, time, function, arg);
|
||||
}
|
||||
|
||||
OSStatus MicoGtimerStop(mico_gtimer_t gtimer)
|
||||
{
|
||||
return lib_api_p->gtimer_apis->MicoGtimerStop(gtimer);
|
||||
}
|
||||
|
||||
OSStatus MicoWdgInitialize( uint32_t timeout )
|
||||
{
|
||||
return lib_api_p->wdg_apis->wdg_init(timeout);
|
||||
|
||||
@@ -4,18 +4,11 @@
|
||||
#include "lwip_api_define.h"
|
||||
#include "mico.h"
|
||||
|
||||
#define INTERFACE_VERSION 3
|
||||
#define INTERFACE_VERSION 2
|
||||
|
||||
typedef void (*ssl_Logging_cb)( const int logLevel,
|
||||
const char * const logMessage );
|
||||
|
||||
#ifndef BIT
|
||||
#define BIT(__n) (1<<(__n))
|
||||
#endif
|
||||
|
||||
#define DSLEEP_WAKEUP_BY_TIMER BIT(0)
|
||||
#define DSLEEP_WAKEUP_BY_GPIO BIT(2) // GPIO Port(PA_18, PA_5, PA_22, PA_23)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/** US FCC */
|
||||
@@ -183,12 +176,6 @@ typedef struct
|
||||
OSStatus (*spi_finalize)( const mico_spi_device_t* spi );
|
||||
} spi_api_t;
|
||||
|
||||
typedef struct {
|
||||
OSStatus (*MicoGtimerInitialize)(mico_gtimer_t gtimer);
|
||||
OSStatus (*MicoGtimerStart)(mico_gtimer_t timer, mico_gtimer_mode_t mode, uint32_t time, mico_gtimer_irq_callback_t function, void *arg);
|
||||
OSStatus (*MicoGtimerStop)(mico_gtimer_t timer);
|
||||
} gtimer_api_t;
|
||||
|
||||
/* API type define */
|
||||
typedef struct mico_api_struct
|
||||
{
|
||||
@@ -388,7 +375,7 @@ typedef struct mico_api_struct
|
||||
|
||||
/* Power management*/
|
||||
int (*pm_mcu_state)( power_state_t state, uint32_t time_dur );
|
||||
int (*pm_wakeup_source)( uint8_t wake_source );
|
||||
int (*pm_wakeup_source)( );
|
||||
void (*wifi_off_mcu_standby)( int seconds );
|
||||
void (*MicoMcuPowerSaveConfig)( int enable );
|
||||
|
||||
@@ -430,7 +417,6 @@ typedef struct mico_api_struct
|
||||
adc_api_t *adc_apis;
|
||||
i2c_api_t *i2c_apis;
|
||||
spi_api_t *spi_apis;
|
||||
gtimer_api_t *gtimer_apis;
|
||||
|
||||
int (*ssl_set_loggingcb)( ssl_Logging_cb f );
|
||||
int (*wlan_inject_frame)( const uint8_t *buff, size_t len );
|
||||
@@ -493,7 +479,6 @@ typedef struct user_api_struct
|
||||
void (*mico_rtos_stack_overflow)( char *taskname );
|
||||
const platform_peripherals_pinmap_t *pinmaps;
|
||||
const mico_gpio_init_t *gpio_init;
|
||||
const uint8_t stdio_break_in;
|
||||
} user_api_t;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -113,7 +113,6 @@ typedef struct {
|
||||
void* (*ssl_nonblock_connect)(int fd, int calen, char*ca, int *errno, int timeout);
|
||||
void (*ssl_set_client_cert)(const char *_cert_pem, const char *private_key_pem);
|
||||
void* (*ssl_connect_sni)(int fd, int calen, char*ca, char *sni_servername, int *errno);
|
||||
void (*ssl_set_ecc)(int enable);
|
||||
} ssl_crypto_api_v1_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -153,9 +152,6 @@ typedef struct {
|
||||
int (*wifi_set_country)(int country_code);
|
||||
int (*wlan_rx_mgnt_set)(int enable, mgnt_handler_t cb);
|
||||
void (*autoconfig_start)(int seconds, int mode);
|
||||
void (*wlan_set_softap_tdma)(int value);
|
||||
int (*wifi_off_fastly)(void);
|
||||
int (*OpenEasylink_softap)(int timeout, char *ssid, char*key, int channel);
|
||||
} wifi_api_v1_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -207,7 +203,6 @@ typedef struct {
|
||||
OSStatus (*MicoUartRecv)( mico_uart_t uart, void* data, uint32_t size, uint32_t timeout );
|
||||
uint32_t (*MicoUartGetLengthInBuffer)( mico_uart_t uart );
|
||||
void (*MicoUartPinRedirect)(mico_uart_t uart);
|
||||
int (*disable_log_uart)(void);
|
||||
} uart_api_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -219,7 +214,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* Power management*/
|
||||
int (*pm_mcu_state)(power_state_t state, uint32_t time_dur);
|
||||
int (*pm_wakeup_source)(uint8_t wake_source);
|
||||
int (*pm_wakeup_source)();
|
||||
void (*wifi_off_mcu_standby)(uint32_t seconds);
|
||||
void (*MicoMcuPowerSaveConfig)( int enable );
|
||||
} power_save_api_t;
|
||||
@@ -238,7 +233,7 @@ typedef struct
|
||||
wifi_api_t *wifi_apis;
|
||||
cli_api_t *cli_apis;
|
||||
|
||||
flash_api_t *flash_apis;
|
||||
flash_api_t *flash_apis;
|
||||
gpio_api_t *gpio_apis;
|
||||
uart_api_t *uart_apis;
|
||||
i2c_api_t *i2c_apis;
|
||||
@@ -248,7 +243,6 @@ typedef struct
|
||||
wdg_api_t *wdg_apis;
|
||||
adc_api_t *adc_apis;
|
||||
power_save_api_t *ps_apis;
|
||||
gtimer_api_t *gtimer_apis;
|
||||
} kernel_api_v1_t;
|
||||
|
||||
typedef kernel_api_v1_t kernel_api_t;
|
||||
|
||||
Reference in New Issue
Block a user