Skip to content

Commit

Permalink
Merge pull request alibaba#212 from alibaba/dev_licheng
Browse files Browse the repository at this point in the history
code synchronization at 2018-04-23@20:38
  • Loading branch information
junjiec authored Apr 24, 2018
2 parents 44239bf + d513c4e commit e98778e
Show file tree
Hide file tree
Showing 31 changed files with 66 additions and 30 deletions.
1 change: 0 additions & 1 deletion board/developerkit/developerkit.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ GLOBAL_LDFLAGS += -T board/developerkit/STM32L496VGTx_FLASH.ld
endif

sal ?= 1
no_tls ?= 1
ifeq (1,$(sal))
$(NAME)_COMPONENTS += sal
module ?= wifi.mk3060
Expand Down
1 change: 1 addition & 0 deletions build/autobuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ csky_platforms=""

if [ "$(uname)" = "Linux" ]; then
CUR_OS="Linux"
csky_platforms="hobbit1_evb"
elif [ "$(uname)" = "Darwin" ]; then
CUR_OS="OSX"
linux_platforms=""
Expand Down
6 changes: 5 additions & 1 deletion example/linkkitapp/linkkit-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void reboot_system(void *parms)
}

static void cloud_service_event(input_event_t *event, void *priv_data) {
static uint8_t awss_reported=0;
if (event->type != EV_YUNIO) {
return;
}
Expand All @@ -83,7 +84,10 @@ static void cloud_service_event(input_event_t *event, void *priv_data) {

if (event->code == CODE_YUNIO_ON_CONNECTED) {
LOG("user sub and pub here");
awss_report_cloud();
if(!awss_reported) {
awss_report_cloud();
awss_reported=1;
}
return;
}

Expand Down
1 change: 1 addition & 0 deletions example/mqttapp/mqtt-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static void mqtt_work(void *parms) {
if(cnt < 200) {
aos_post_delayed_action(3000, mqtt_work, NULL);
} else {
aos_cancel_delayed_action(3000, mqtt_work, NULL);
mqtt_unsubscribe(TOPIC_GET);
aos_msleep(200);
mqtt_deinit_instance();
Expand Down
Binary file modified framework/bluetooth/ais_ilop/ali_lib/lib/cortex-m4/ali_lib.a
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions framework/connectivity/link-coap/platform/iot_import.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ uint64_t HAL_UptimeMs(void);
*/
void HAL_SleepMs(_IN_ uint32_t ms);

/**
* @brief get time left
*
* @param [in] ms time of end. [in] ms time of now
* @return time left.
* @see None.
* @note None.
*/
uint64_t aliot_platform_time_left(uint64_t t_end, uint64_t t_now);

/**
* @brief Set seed for a sequence of pseudo-random integers, which will be returned by HAL_Random()
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ int work_queue_init(void)
};

int stack_used = 0;
ret = HAL_ThreadCreate(&g_wq_thread, worker_thread, NULL, NULL, &stack_used);
ret = HAL_ThreadCreate(&g_wq_thread, worker_thread, NULL, &threadParams, &stack_used);
OS_ASSERT(ret == 0, "thread create failed!");

return 0;
Expand Down
11 changes: 11 additions & 0 deletions framework/protocol/linkkit/iotkit/sdk-encap/iot_import.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ void HAL_Free(_IN_ void *ptr);
*/
uint64_t HAL_UptimeMs(void);

/**
* @brief get time left
*
* @param [in] ms time of end. [in] ms time of now
* @return time left.
* @see None.
* @note None.
*/
uint64_t aliot_platform_time_left(uint64_t t_end, uint64_t t_now);


/**
* @brief 使调用线程睡眠入参ms指定的毫秒数
*
Expand Down
Binary file modified framework/ywss/lib/arm968es/libywss.a
Binary file not shown.
Binary file modified framework/ywss/lib/cortex-m4/libywss.a
Binary file not shown.
Binary file modified framework/ywss/lib/xtensa/libywss.a
Binary file not shown.
Binary file modified framework/ywss4linkkit/lib/arm968es/libywss.a
Binary file not shown.
Binary file modified framework/ywss4linkkit/lib/cortex-m4/libywss.a
Binary file not shown.
Binary file modified framework/ywss4linkkit/lib/linux/libywss.a
Binary file not shown.
Binary file modified framework/ywss4linkkit/lib/xtensa/libywss.a
Binary file not shown.
Binary file modified kernel/protocols/mesh/lib/arm968es/libmesh.a
Binary file not shown.
Binary file modified kernel/protocols/mesh/lib/cortex-m4/libmesh.a
Binary file not shown.
Binary file modified kernel/protocols/mesh/lib/xtensa/libmesh.a
Binary file not shown.
1 change: 1 addition & 0 deletions kernel/rhino/core/include/k_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#else //(RHINO_CONFIG_MM_REGION_MUTEX != 0)
#define MM_CRITICAL_ENTER(pmmhead) \
do { \
CPSR_ALLOC(); \
RHINO_CRITICAL_ENTER(); \
if (g_intrpt_nested_level[cpu_cur_get()] > 0u) { \
k_err_proc(RHINO_NOT_CALLED_BY_INTRPT); \
Expand Down
2 changes: 1 addition & 1 deletion kernel/vcall/mico/include/mico_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "common.h"

#include "platform.h" /* This file is unique for each platform */
//#include "platform.h" /* This file is unique for each platform */
#include "platform_peripheral.h"

#ifdef __cplusplus
Expand Down
4 changes: 3 additions & 1 deletion kernel/yloop/local_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static void handle_events(input_event_t *event);
static int input_add_event(int fd, input_event_t *event);
static void event_read_cb(int fd, void *param);

extern yloop_ctx_t *g_main_ctx;
/* Handle events
* just dispatch
*/
Expand Down Expand Up @@ -157,7 +158,8 @@ int aos_unregister_event_filter(uint16_t type, aos_event_cb cb, void *priv)
static int _schedule_call(aos_loop_t *loop, aos_call_t fun, void *arg,
bool urgent)
{
if (fun == NULL) {

if (fun == NULL || g_main_ctx == NULL) {
return -EINVAL;
}

Expand Down
20 changes: 2 additions & 18 deletions kernel/yloop/yloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@

#define TAG "yloop"

typedef struct {
int sock;
void *private_data;
aos_poll_call_t cb;
} yloop_sock_t;

typedef struct yloop_timeout_s {
dlist_t next;
long long timeout_ms;
Expand All @@ -29,18 +23,8 @@ typedef struct yloop_timeout_s {
int ms;
} yloop_timeout_t;

typedef struct {
dlist_t timeouts;
struct pollfd *pollfds;
yloop_sock_t *readers;
int eventfd;
uint8_t max_sock;
uint8_t reader_count;
bool pending_terminate;
bool terminate;
} yloop_ctx_t;

static yloop_ctx_t *g_main_ctx;

yloop_ctx_t *g_main_ctx = NULL;
static aos_task_key_t g_loop_key;

static inline void _set_context(yloop_ctx_t *ctx)
Expand Down
16 changes: 16 additions & 0 deletions kernel/yloop/yloop.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
#ifndef YLOOP_H
#define YLOOP_H

typedef struct {
int sock;
void *private_data;
aos_poll_call_t cb;
} yloop_sock_t;

typedef struct {
dlist_t timeouts;
struct pollfd *pollfds;
yloop_sock_t *readers;
int eventfd;
uint8_t max_sock;
uint8_t reader_count;
bool pending_terminate;
bool terminate;
} yloop_ctx_t;
/* set loop's event fd */
void aos_loop_set_eventfd(int fd);

Expand Down
Binary file modified platform/mcu/moc108/libmoc108.a
Binary file not shown.
2 changes: 1 addition & 1 deletion platform/mcu/rtl8710bn/peripherals/platform_8711.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//#include "string.h"

//#include "platform.h"
#include "platform_config.h"
//#include "platform_config.h"
#include "platform_peripheral.h"
#include "platform_logging.h"
//#include "MicoPlatform.h"
Expand Down
2 changes: 1 addition & 1 deletion platform/mcu/rtl8710bn/peripherals/platform_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//#include "MICOPlatform.h"
//#include "MICORTOS.h"

#include "platform.h"
//#include "platform.h"
#include "platform_peripheral.h"
#include "platform_logging.h"
#include "analogin_api.h"
Expand Down
2 changes: 1 addition & 1 deletion platform/mcu/rtl8710bn/peripherals/platform_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//#include "MICOPlatform.h"

#include "board.h"
#include "platform_config.h"
//#include "platform_config.h"
#include "platform_peripheral.h"
#include "debug.h"

Expand Down
6 changes: 3 additions & 3 deletions platform/mcu/rtl8710bn/script/manipulate_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ ${PICK} 0x`grep __xip_image2_start__ ${BIN_DIR}/${outputname}.nmap | gawk '{prin
IMAGE2_OTA1=image2_all_ota1.bin
IMAGE2_OTA2=image2_all_ota2.bin
OTA_ALL=ota_all.bin
if [ "${ota_idx}" == "1" ]; then
if [ "${ota_idx}" = "1" ]; then
cat ${BIN_DIR}/xip_image2.p.bin > ${BIN_DIR}/${IMAGE2_OTA1}
chmod 777 ${BIN_DIR}/${IMAGE2_OTA1}
cat ${BIN_DIR}/ram_2.p.bin >> ${BIN_DIR}/${IMAGE2_OTA1}
${CHKSUM} ${BIN_DIR}/${IMAGE2_OTA1} || true
rm ${BIN_DIR}/xip_image2.p.bin ${BIN_DIR}/ram_2.p.bin
elif [ "${ota_idx}" == "2" ]; then
elif [ "${ota_idx}" = "2" ]; then
cat ${BIN_DIR}/xip_image2.p.bin > ${BIN_DIR}/${IMAGE2_OTA2}
chmod 777 ${BIN_DIR}/${IMAGE2_OTA2}
cat ${BIN_DIR}/ram_2.p.bin >> ${BIN_DIR}/${IMAGE2_OTA2}
Expand All @@ -69,4 +69,4 @@ else
echo “ota_idx must be "1" or "2"
echo “===========================================================”
fi
# rm -f ${BIN_DIR}/ram_2.bin ${BIN_DIR}/ram_2.p.bin ${BIN_DIR}/ram_2.r.bin ${BIN_DIR}/xip_image2.bin ${BIN_DIR}/xip_image2.p.bin
# rm -f ${BIN_DIR}/ram_2.bin ${BIN_DIR}/ram_2.p.bin ${BIN_DIR}/ram_2.r.bin ${BIN_DIR}/xip_image2.bin ${BIN_DIR}/xip_image2.p.bin
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,13 @@ void fATW6(void *arg){
return;
}

#ifndef WEAK
#define WEAK __attribute__((weak))
#endif

void WEAK awss_report_reset(void){}
void WEAK do_awss_active(void){}

void fATWA(void *arg){
#if 1
awss_report_reset();
Expand Down
2 changes: 1 addition & 1 deletion platform/mcu/stm32l4xx_cube/aos/aos.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>

#define AOS_START_STACK 1024
#define AOS_START_STACK 1536

static ktask_t demo_task_obj;
cpu_stack_t demo_task_buf[AOS_START_STACK];
Expand Down

0 comments on commit e98778e

Please sign in to comment.