forked from xuos/xiuos
1.repair the separate compile error;2.modify ota init task
This commit is contained in:
parent
8b2eee0aa0
commit
9959ec6470
|
@ -20,7 +20,9 @@ int main(void)
|
||||||
{
|
{
|
||||||
printf("Hello, world!\n");
|
printf("Hello, world!\n");
|
||||||
FrameworkInit();
|
FrameworkInit();
|
||||||
|
#ifdef APPLICATION_OTA
|
||||||
ApplicationOtaTaskInit();
|
ApplicationOtaTaskInit();
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// int cppmain(void);
|
// int cppmain(void);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
menu "config application bin ota "
|
menu "ota app "
|
||||||
menuconfig APPLICATION_OTA
|
menuconfig APPLICATION_OTA
|
||||||
bool "Using app bin ota"
|
bool "Using app bin ota"
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -51,7 +51,7 @@ int Adapter4GInit(void)
|
||||||
|
|
||||||
struct Adapter *adapter = PrivMalloc(sizeof(struct Adapter));
|
struct Adapter *adapter = PrivMalloc(sizeof(struct Adapter));
|
||||||
if (!adapter) {
|
if (!adapter) {
|
||||||
Privfree(adapter);
|
PrivFree(adapter);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ int Adapter4GInit(void)
|
||||||
ret = Adapter4GRegister(adapter);
|
ret = Adapter4GRegister(adapter);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printf("Adapter4GInit register 4G adapter error\n");
|
printf("Adapter4GInit register 4G adapter error\n");
|
||||||
Privfree(adapter);
|
PrivFree(adapter);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ int Adapter4GInit(void)
|
||||||
AdapterProductInfoType product_info = Ec200tAttach(adapter);
|
AdapterProductInfoType product_info = Ec200tAttach(adapter);
|
||||||
if (!product_info) {
|
if (!product_info) {
|
||||||
printf("Adapter4GInit ec200t attach error\n");
|
printf("Adapter4GInit ec200t attach error\n");
|
||||||
Privfree(adapter);
|
PrivFree(adapter);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ int PrivTaskDelay(int32_t ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************fs**************************/
|
/*********************fs**************************/
|
||||||
|
#ifdef FS_VFS
|
||||||
/************************Driver Posix Transform***********************/
|
/************************Driver Posix Transform***********************/
|
||||||
int PrivOpen(const char *path, int flags)
|
int PrivOpen(const char *path, int flags)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +150,7 @@ int PrivIoctl(int fd, int cmd, void *args)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/********************memory api************/
|
/********************memory api************/
|
||||||
void *PrivMalloc(size_t size)
|
void *PrivMalloc(size_t size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct PinParam
|
||||||
long pin;//< pin number
|
long pin;//< pin number
|
||||||
int mode;//< pin mode: input/output
|
int mode;//< pin mode: input/output
|
||||||
struct PinDevIrq irq_set;//< pin irq set
|
struct PinDevIrq irq_set;//< pin irq set
|
||||||
uint64 arg;
|
uint64_t arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PinStat
|
struct PinStat
|
||||||
|
@ -128,7 +128,7 @@ struct SerialDataCfg
|
||||||
uint8_t serial_invert_mode;
|
uint8_t serial_invert_mode;
|
||||||
uint16_t serial_buffer_size;
|
uint16_t serial_buffer_size;
|
||||||
|
|
||||||
uint8 ext_uart_no;
|
uint8_t ext_uart_no;
|
||||||
enum ExtSerialPortConfigure port_configure;
|
enum ExtSerialPortConfigure port_configure;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,16 +22,16 @@
|
||||||
#ifndef XS_USER_API_H
|
#ifndef XS_USER_API_H
|
||||||
#define XS_USER_API_H
|
#define XS_USER_API_H
|
||||||
|
|
||||||
#include <xiuos.h>
|
|
||||||
#include <xsconfig.h>
|
#include <xsconfig.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
#include "../../../../../../Ubiquitous/XiUOS/arch/kswitch.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SEPARATE_COMPILE
|
#ifdef SEPARATE_COMPILE
|
||||||
|
|
||||||
|
#include "../../../../../../Ubiquitous/XiUOS/arch/kswitch.h"
|
||||||
|
|
||||||
#define TASK_INFO 1
|
#define TASK_INFO 1
|
||||||
#define MEM_INFO 2
|
#define MEM_INFO 2
|
||||||
#define SEM_INFO 3
|
#define SEM_INFO 3
|
||||||
|
@ -58,22 +58,22 @@ typedef void DIR;
|
||||||
|
|
||||||
int32_t UserTaskCreate(UtaskType utask);
|
int32_t UserTaskCreate(UtaskType utask);
|
||||||
|
|
||||||
x_err_t UserTaskStartup(int32_t id);
|
long UserTaskStartup(int32_t id);
|
||||||
x_err_t UserTaskDelete(int32_t id);
|
long UserTaskDelete(int32_t id);
|
||||||
void UserTaskQuit(void);
|
void UserTaskQuit(void);
|
||||||
x_err_t UserTaskDelay(int32_t ms);
|
long UserTaskDelay(int32_t ms);
|
||||||
x_err_t UserGetTaskName(int32_t id ,char *name);
|
long UserGetTaskName(int32_t id ,char *name);
|
||||||
int32_t UserGetTaskID(void);
|
int32_t UserGetTaskID(void);
|
||||||
uint8_t UserGetTaskStat(int32_t id);
|
uint8_t UserGetTaskStat(int32_t id);
|
||||||
|
|
||||||
#ifdef ARCH_SMP
|
#ifdef ARCH_SMP
|
||||||
x_err_t UserTaskCoreCombine(int32_t id,uint8_t core_id);
|
long UserTaskCoreCombine(int32_t id,uint8_t core_id);
|
||||||
x_err_t UserTaskCoreUnCombine(int32_t id);
|
long UserTaskCoreUnCombine(int32_t id);
|
||||||
uint8_t UserGetTaskCombinedCore(int32_t id);
|
uint8_t UserGetTaskCombinedCore(int32_t id);
|
||||||
uint8_t UserGetTaskRunningCore(int32_t id);
|
uint8_t UserGetTaskRunningCore(int32_t id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x_err_t UserGetTaskErrorstatus(int32_t id);
|
long UserGetTaskErrorstatus(int32_t id);
|
||||||
uint8_t UserGetTaskPriority(int32_t id);
|
uint8_t UserGetTaskPriority(int32_t id);
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,10 +93,10 @@ int32_t UserMutexAbandon(int32_t mutex);
|
||||||
#ifdef KERNEL_SEMAPHORE
|
#ifdef KERNEL_SEMAPHORE
|
||||||
typedef int32 sem_t;
|
typedef int32 sem_t;
|
||||||
sem_t UserSemaphoreCreate(uint16_t val);
|
sem_t UserSemaphoreCreate(uint16_t val);
|
||||||
x_err_t UserSemaphoreDelete(sem_t sem);
|
long UserSemaphoreDelete(sem_t sem);
|
||||||
x_err_t UserSemaphoreObtain(sem_t sem, int32_t wait_time);
|
long UserSemaphoreObtain(sem_t sem, int32_t wait_time);
|
||||||
x_err_t UserSemaphoreAbandon(sem_t sem);
|
long UserSemaphoreAbandon(sem_t sem);
|
||||||
x_err_t UserSemaphoreSetValue(sem_t sem, uint16_t val);
|
long UserSemaphoreSetValue(sem_t sem, uint16_t val);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,22 +104,22 @@ x_err_t UserSemaphoreSetValue(sem_t sem, uint16_t val);
|
||||||
typedef int32 EventIdType;
|
typedef int32 EventIdType;
|
||||||
EventIdType UserEventCreate(uint8_t flag);
|
EventIdType UserEventCreate(uint8_t flag);
|
||||||
void UserEventDelete(EventIdType event);
|
void UserEventDelete(EventIdType event);
|
||||||
x_err_t UserEventTrigger(EventIdType event, uint32_t set);
|
long UserEventTrigger(EventIdType event, uint32_t set);
|
||||||
x_err_t UserEventProcess(EventIdType event, uint32_t set, uint8_t option,
|
long UserEventProcess(EventIdType event, uint32_t set, uint8_t option,
|
||||||
int32_t wait_time, uint32_t *Recved);
|
int32_t wait_time, uint32_t *Recved);
|
||||||
x_err_t UserEventReinit(EventIdType event);
|
long UserEventReinit(EventIdType event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef KERNEL_MESSAGEQUEUE
|
#ifdef KERNEL_MESSAGEQUEUE
|
||||||
int32_t UserMsgQueueCreate(size_t msg_size, size_t max_msgs);
|
int32_t UserMsgQueueCreate(size_t msg_size, size_t max_msgs);
|
||||||
x_err_t UserMsgQueueDelete(int32_t mq );
|
long UserMsgQueueDelete(int32_t mq );
|
||||||
x_err_t UserMsgQueueSendwait(int32_t mq, const void *buffer,
|
long UserMsgQueueSendwait(int32_t mq, const void *buffer,
|
||||||
size_t size, int32_t wait_time);
|
size_t size, int32_t wait_time);
|
||||||
x_err_t UserMsgQueueSend(int32_t mq, const void *buffer, size_t size);
|
long UserMsgQueueSend(int32_t mq, const void *buffer, size_t size);
|
||||||
x_err_t UserMsgQueueUrgentSend(int32_t mq, const void *buffer, size_t size);
|
long UserMsgQueueUrgentSend(int32_t mq, const void *buffer, size_t size);
|
||||||
x_err_t UserMsgQueueRecv(int32_t mq, void *buffer, size_t size,int32_t wait_time);
|
long UserMsgQueueRecv(int32_t mq, void *buffer, size_t size,int32_t wait_time);
|
||||||
x_err_t UserMsgQueueReinit(int32_t mq);
|
long UserMsgQueueReinit(int32_t mq);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int open(const char *path, int flags, ...);
|
int open(const char *path, int flags, ...);
|
||||||
|
@ -154,14 +154,18 @@ struct statfs {
|
||||||
};
|
};
|
||||||
|
|
||||||
int statfs(const char *path, struct statfs *buf);
|
int statfs(const char *path, struct statfs *buf);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/* NOTE!!!: when cutting out file system, the 'printf' function can not output angthing */
|
||||||
int Userprintf(const char *fmt, ...);
|
int Userprintf(const char *fmt, ...);
|
||||||
|
#define printf Userprintf
|
||||||
|
|
||||||
#define printf Userprintf
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include <xiuos.h>
|
||||||
|
|
||||||
#ifdef FS_VFS
|
#ifdef FS_VFS
|
||||||
#include <iot-vfs_posix.h>
|
#include <iot-vfs_posix.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -182,7 +186,7 @@ int32_t UserTaskCreate(UtaskType utask);
|
||||||
#define UserTaskQuit KTaskQuit
|
#define UserTaskQuit KTaskQuit
|
||||||
#define UserTaskDelay MdelayKTask
|
#define UserTaskDelay MdelayKTask
|
||||||
|
|
||||||
x_err_t UserGetTaskName(int32_t id ,char *name);
|
long UserGetTaskName(int32_t id ,char *name);
|
||||||
int32_t UserGetTaskID(void);
|
int32_t UserGetTaskID(void);
|
||||||
uint8_t UserGetTaskStat(int32_t id);
|
uint8_t UserGetTaskStat(int32_t id);
|
||||||
|
|
||||||
|
@ -194,7 +198,7 @@ uint8_t UserGetTaskCombinedCore(int32_t id);
|
||||||
uint8_t UserGetTaskRunningCore(int32_t id);
|
uint8_t UserGetTaskRunningCore(int32_t id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x_err_t UserGetTaskErrorstatus(int32_t id);
|
long UserGetTaskErrorstatus(int32_t id);
|
||||||
uint8_t UserGetTaskPriority(int32_t id);
|
uint8_t UserGetTaskPriority(int32_t id);
|
||||||
|
|
||||||
#define UserMalloc x_malloc
|
#define UserMalloc x_malloc
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include <xs_sem.h>
|
#include <xs_sem.h>
|
||||||
#include <xs_memory.h>
|
#include <xs_memory.h>
|
||||||
#include <xs_mutex.h>
|
#include <xs_mutex.h>
|
||||||
|
#include <xs_event.h>
|
||||||
|
#include <xs_msg.h>
|
||||||
|
|
||||||
#ifdef FS_VFS
|
#ifdef FS_VFS
|
||||||
#include <iot-vfs_posix.h>
|
#include <iot-vfs_posix.h>
|
||||||
|
|
Loading…
Reference in New Issue