Skip to content

Commit 0a288ef

Browse files
committed
first version
1 parent 72c3718 commit 0a288ef

30 files changed

+8956
-8562
lines changed

projects/LPT230_gcc.uvguix.Farry

+89-26
Large diffs are not rendered by default.

projects/LPT230_gcc_LPT230.dep

+493-490
Large diffs are not rendered by default.

projects/app_main.o

0 Bytes
Binary file not shown.

projects/cjson.o

0 Bytes
Binary file not shown.

projects/httpd.d

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ httpd.o: ../src/httpd.c ../sdk/4.13/include/mbed_config.h \
7070
c:\program\ files\ (x86)\gnu\ tools\ arm\ embedded\5.4\ 2016q3\arm-none-eabi\include\sys\string.h \
7171
c:\program\ files\ (x86)\gnu\ tools\ arm\ embedded\5.4\ 2016q3\arm-none-eabi\include\time.h \
7272
c:\program\ files\ (x86)\gnu\ tools\ arm\ embedded\5.4\ 2016q3\arm-none-eabi\include\machine\time.h \
73-
../src/httpd.h
73+
../src/appmain.h ../src/httpd.h ../src/cJSON/cJSON.h \
74+
../src/user_function.h

projects/httpd.o

4.87 KB
Binary file not shown.

projects/lpt230_gcc.bin

2.04 KB
Binary file not shown.

projects/lpt230_gcc.build_log.htm

+16-9
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,26 @@ <h2>Output:</h2>
2828
Rebuild target 'LPT230'
2929
assembling startup_LPBX3GCC.S...
3030
compiling user_mdns.c...
31-
compiling httpd.c...
32-
../src/httpd.c: In function 'httpd_init':
33-
../src/httpd.c(149): warning: implicit declaration of function 'hfhttpd_url_callback_register' [-Wimplicit-function-declaration]
34-
compiling user_flash.c...
35-
../src/user_flash.c(8): warning: 'upadateConfigData' defined but not used [-Wunused-function]
36-
compiling user_function.c...
37-
compiling app_main.c...
31+
../src/user_mdns.c(11): warning: 'txt_record' defined but not used [-Wunused-variable]
32+
static char txt_record[] = "name=TC1_A2:model=com.iotserv.devices.phicomm_tc1_a1:mac=GHS00GG:id=GHS00GG";//max len is 255
3833
compiling user_gpio.c...
3934
../src/user_gpio.c: In function 'key_timeout_handler':
4035
../src/user_gpio.c(178): warning: implicit declaration of function 'user_function_cmd_received' [-Wimplicit-function-declaration]
4136
user_function_cmd_received(1,"{\"cmd\":\"device report\"}");
4237
../src/user_gpio.c(146): warning: variable 'key_last' set but not used [-Wunused-but-set-variable]
4338
../src/user_gpio.c(145): warning: unused variable 'key_trigger' [-Wunused-variable]
39+
compiling app_main.c...
40+
compiling user_flash.c...
41+
../src/user_flash.c(8): warning: 'upadateConfigData' defined but not used [-Wunused-function]
42+
compiling httpd.c...
43+
../src/httpd.c: In function 'switch_cbk':
44+
../src/httpd.c(206): warning: implicit declaration of function 'json_plug_analysis' [-Wimplicit-function-declaration]
45+
../src/httpd.c(203): warning: variable 'update_user_config_flag' set but not used [-Wunused-but-set-variable]
46+
../src/httpd.c: In function 'httpd_init':
47+
../src/httpd.c(238): warning: implicit declaration of function 'hfhttpd_url_callback_register' [-Wimplicit-function-declaration]
48+
../src/httpd.c: At top level:
49+
../src/httpd.c(41): warning: 'convert_ascii' defined but not used [-Wunused-function]
50+
compiling user_function.c...
4451
compiling user_power.c...
4552
compiling user_udp.c...
4653
../src/user_udp.c: In function 'udp_thread':
@@ -52,14 +59,14 @@ <h2>Output:</h2>
5259
linking...
5360
After Build - User command #1: ../tools/arm-none-eabi-objcopy -O binary ./lpt230_gcc.elf ./lpt230_gcc.bin
5461
After Build - User command #2: ../tools/LPB100_IMG_Tools.exe LPB230 lzma ../tools/bootloader.bin lpt230_gcc.bin ./lpt230_gcc_image.bin ./lpt230_gcc_upgrade.bin
55-
".\lpt230_gcc.elf" - 0 Error(s), 8 Warning(s).
62+
".\lpt230_gcc.elf" - 0 Error(s), 12 Warning(s).
5663

5764
<h2>Collection of Component include folders:</h2>
5865
C:\Users\Farry\Documents\KeilProject\LPx30-HSF_v4.13.20\projects\RTE
5966
C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\Device\ARM\ARMCM4\Include
6067

6168
<h2>Collection of Component Files used:</h2>
62-
Build Time Elapsed: 00:00:06
69+
Build Time Elapsed: 00:00:16
6370
</pre>
6471
</body>
6572
</html>

projects/lpt230_gcc.elf

2.82 KB
Binary file not shown.

projects/lpt230_gcc.map

+8,006-8,004
Large diffs are not rendered by default.

projects/lpt230_gcc_image.bin

2.04 KB
Binary file not shown.

projects/user_flash.o

0 Bytes
Binary file not shown.

projects/user_gpio.o

0 Bytes
Binary file not shown.

projects/user_mdns.o

1.41 KB
Binary file not shown.

sdk/4.13/include/hsf/hfconfig.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ enum ENNETSETPRO
289289
NETSETPRO_UDP,
290290
NETSETPRO_MQTT,
291291
NETSETPRO_ALIOT,
292-
NETSETPRO_HTTP
292+
NETSETPRO_HTTP,
293+
NETSETPRO_HTTP_TLS,
294+
NETSETPRO_TCP_TLS
293295
};
294296

295297
typedef enum ENBAUDRATE

sdk/4.13/include/hsf/hfflashlayout.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
#define CONFIG_FLASH_SIZE_1MB
14-
14+
//#define CONFIG_FLASH_SIZE_2MB
1515

1616
#ifdef CONFIG_FLASH_SIZE_1MB
1717

sdk/4.13/include/hsf/hfsys.h

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ void HSF_API hfsys_stop_watchdog(void);
314314
*/
315315
unsigned int HSF_API hfsys_random(void);
316316

317+
317318
#ifdef __cplusplus
318319
}
319320
#endif

sdk/4.13/include/hsf/hsf.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ typedef unsigned char bool;
7878
#define GLOBAL_VER "4.13"
7979

8080
#ifdef CONFIG_FLASH_SIZE_1MB
81-
#define GLOBAL_LVER "24 (2019-09-24 10:00 1M)"
81+
#define GLOBAL_LVER "26 (2019-12-17 19:00 1M)"
8282
#elif defined CONFIG_FLASH_SIZE_2MB
83-
#define GLOBAL_LVER "24 (2019-09-24 10:00 2M)"
83+
#define GLOBAL_LVER "26 (2019-12-17 19:00 2M)"
8484
#elif defined CONFIG_FLASH_SIZE_4MB
85-
#define GLOBAL_LVER "24 (2019-09-24 10:00 4M)"
85+
#define GLOBAL_LVER "26 (2019-12-17 19:00 4M)"
8686
#endif
8787

8888

sdk/4.13/include/hsf/wm-tls.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ typedef enum {
3737
TLS_CHECK_CLIENT_CERT = 0x02,
3838

3939
/* TLS Client mode */
40+
TLS_NO_SERVER_CERT = 0x00,
4041
TLS_CHECK_SERVER_CERT = 0x04,
4142
} tls_session_flags_t;
4243

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*****************************************************************************/
2+
/* */
3+
/* File Name : csl_mbed.h */
4+
/* */
5+
/* Description : This file contains all declarations and functions */
6+
/* related to the chip support library. */
7+
/* */
8+
/* MbedOS Usage : Call maclib_get_funcs_struct() to get MACLib funcs; */
9+
/* Define mbed_reg_func_t var, Register it by ml_init; */
10+
/* */
11+
/*****************************************************************************/
12+
13+
#ifndef CSL_MBED_H
14+
#define CSL_MBED_H
15+
16+
#ifdef __cplusplus
17+
extern "C" {
18+
#endif
19+
20+
/*****************************************************************************/
21+
/* Constants */
22+
/*****************************************************************************/
23+
#define RDA_EXT_INT_MAC_HW_INDEX 8
24+
#define RDA_EXT_INT_MAC_HW_PRI 0x80
25+
26+
/*****************************************************************************/
27+
/* Enums */
28+
/*****************************************************************************/
29+
typedef enum {
30+
MACLIB_EVENT_PEND = 0,
31+
MACLIB_EVENT_PROCESS = 1,
32+
MACLIB_EVENT_CLEANUP = 2
33+
} MACLIB_EVENT_HANDLE_T;
34+
35+
/*****************************************************************************/
36+
/* Data Types */
37+
/*****************************************************************************/
38+
typedef struct
39+
{
40+
unsigned int ml_id; /* Buffer identification */
41+
unsigned char* ml_data; /* Pkt start address */
42+
unsigned short ml_len; /* Pkt length */
43+
} maclib_buf_t;
44+
45+
/* Structure that contains functions provided by MACLib */
46+
typedef struct {
47+
/* Initialize MAC Library, input param: mbed_reg_func_t *reg_funcs */
48+
int (*ml_init)(void *reg_funcs);
49+
50+
/* As a peroid task to process MAC Library background event */
51+
void (*ml_tasklet)(void);
52+
53+
/* Get a new packet buffer, output param: maclib_buf_t *buf */
54+
void (*ml_get_pkt_buf)(void *buf);
55+
56+
/* Mbed stack send packet to MAC Library, input param: maclib_buf_t *buf*/
57+
int (*ml_xmit_pkt)(void *buf);
58+
59+
/* Mbed receive and processing packet done, input param: unsigned int buf_id */
60+
void (*ml_recv_pkt_comp)(unsigned int buf_id);
61+
} maclib_func_t;
62+
63+
/* Structure that contains functions provided by MbedOS */
64+
typedef struct {
65+
/* MAC Library send packet to mbed stack, input param: maclib_buf_t *buf */
66+
void (*mbed_recv_pkt)(void *buf);
67+
68+
/* Critical section start realized in mbed */
69+
void (*mbed_critical_sec_start)(void);
70+
71+
/* Critical section end realized in mbed */
72+
void (*mbed_critical_sec_end)(void);
73+
74+
/* Create interrupt in mbed, input param: vector/priority/isr(function), */
75+
/* return: interrupt handle, non-zero is valid */
76+
void * (*mbed_create_interrupt)(unsigned int vec, unsigned int pri, void *isr);
77+
78+
/* Delete interrupt in mbed, input param: vector */
79+
void (*mbed_delete_interrupt)(unsigned int vec);
80+
81+
/* Enable interrupt in mbed, input param: vector */
82+
void (*mbed_enable_interrupt)(unsigned int vec);
83+
84+
/* Disable interrupt in mbed, input param: vector */
85+
void (*mbed_disable_interrupt)(unsigned int vec);
86+
87+
/* Get current time realized in mbed, return time in units of micro second */
88+
unsigned long (*mbed_get_cur_time_ms)(void);
89+
90+
/* Create alarm in mbed, input param: func(callback)/data(pass to func), */
91+
/* return: alarm handle, non-zero is valid */
92+
void * (*mbed_create_alarm)(void *func, unsigned int data);
93+
94+
/* Delete alarm in mbed, input param: alarm handle */
95+
void (*mbed_delete_alarm)(void **handle);
96+
97+
/* Start alarm in mbed, input param: alarm handle/timeout(micro second) */
98+
void (*mbed_start_alarm)(void *handle, unsigned int timeout_ms);
99+
100+
/* Stop alarm in mbed, input param: alarm handle */
101+
void (*mbed_stop_alarm)(void *handle);
102+
103+
#if defined(MBED_MUTEX_INTERFACE)
104+
/* Create mutex */
105+
void (*mbed_mutex_create)(void);
106+
107+
/* Delete mutex */
108+
unsigned int (*mbed_mutex_delete)(void *rdamutex);
109+
110+
/* Wait mutex, timer unit : millisec */
111+
unsigned int (*mbed_mutex_wait)(void *rdamutex, unsigned int millisec);
112+
113+
/* Release mutex */
114+
unsigned int (*mbed_mutex_release)(void *rdamutex);
115+
#endif /* MBED_MUTEX_INTERFACE */
116+
117+
/* Event post/get callback function, input param: event_type */
118+
void (*mbed_event_hdl_cb)(unsigned int event);
119+
120+
/* maclib task sleep callback function */
121+
void (*mbed_task_sleep_cb)(void);
122+
123+
/* maclib task wakeup callback function */
124+
void (*mbed_task_wakeup_cb)(void);
125+
} maclib_import_func_t;
126+
127+
/*****************************************************************************/
128+
/* Extern Function Declarations */
129+
/*****************************************************************************/
130+
extern void maclib_get_funcs_struct(maclib_func_t *func_str);
131+
132+
#ifdef __cplusplus
133+
}
134+
#endif
135+
136+
#endif /* CSL_MBED_H */

sdk/4.13/include/lwip-wifi/arch/rda5981_flash.h

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ typedef struct {
6363
#define RDA5991H_USER_DATA_FLAG_PHY BIT16
6464
#define RDA5991H_USER_DATA_FLAG_PHY_CHANNELS BIT17
6565
#define RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET BIT18
66+
#define RDA5991H_USER_DATA_FLAG_CAL BIT19
6667

6768
#define RDA5981_VBAT_CAL BIT0
6869
#define RDA5981_GPADC0_CAL BIT1

sdk/4.13/include/lwip-wifi/arch/rda5991h_wland.h

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ extern int rda5981_enter_CE_MODE(unsigned char enable);
157157
extern int rda5981_set_data_rate(unsigned char mode, unsigned char rate);
158158
extern void rda5981_set_mode(unsigned char bgn_enable);// 1~bgn mode, 0~bg mode
159159
extern void rda5981_set_auth_timeout(unsigned char timeout_enable);
160+
extern void rda5981_set_ap_eapol_delay(unsigned int ms);
160161
typedef struct {
161162
char BSSID[ETH_ALEN];
162163
char SSID[32+1];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#ifndef _WLAND_DBG_H_
2+
#define _WLAND_DBG_H_
3+
#include <stdio.h>
4+
#include "rda5991h_wland.h"
5+
#include "wland_types.h"
6+
7+
extern int wland_dbg_dump;
8+
extern int wland_dbg_level;
9+
10+
#define RDA_WLAND_DBG
11+
12+
#ifdef RDA_WLAND_DBG
13+
#define WLAND_DBG(level, fmt, ...) do {\
14+
int dbg_level = D_##level##_LEVEL;\
15+
if((dbg_level <= wland_dbg_level)){\
16+
printf("%s,"fmt, __func__, ##__VA_ARGS__);\
17+
} \
18+
} while (0)
19+
/*
20+
#define WLAND_ERR(fmt, ...) do {\
21+
printf("[RDAWLAN_ERR]: " fmt, ##__VA_ARGS__);\
22+
} while (0)
23+
*/
24+
//if frmae_len is zero, get len from frame header
25+
static inline void wland_dump_frame(const char* msg, u8 *data, u32 frame_len)
26+
{
27+
28+
u32 len,i;
29+
30+
if(wland_dbg_dump == 1){
31+
if(frame_len != 0)
32+
len = frame_len;
33+
else
34+
len = data[0] | ((data[1]&0x0f) << 8);
35+
printf("%s : ",msg);
36+
for(i=0; i<len; i++)
37+
printf("%02x ", *(data+i));
38+
printf("\r\nframe_len=%d\r\n", len);
39+
}
40+
return;
41+
}
42+
#else
43+
#define WLAND_DBG(level, fmt, ...)
44+
static inline void wland_dump_frame(const char* msg, u8 *data, u32 frame_len)
45+
{}
46+
#endif
47+
#endif /*_WLAND_DBG_H_*/

sdk/4.13/include/lwip-wifi/arch/wland_flash.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ typedef struct
6262
RDA5991H_USER_DATA_FLAG_RF_CHANNELS | \
6363
RDA5991H_USER_DATA_FLAG_PHY | \
6464
RDA5991H_USER_DATA_FLAG_PHY_CHANNELS | \
65-
RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET)))
65+
RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET | \
66+
RDA5991H_USER_DATA_FLAG_CAL)))
6667

6768
#define RDA5991H_USER_DATA_IP_LENGTH 8
6869

@@ -94,6 +95,7 @@ typedef struct
9495
wland_rf_channels_t rf_channels;
9596
wland_phy_t phy;
9697
wland_phy_channels_t phy_channels;
98+
u32 cal_flag;
9799
}rda5991h_user_data;
98100

99101
#define SECTOR_SIZE 4096
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef _WLAND_OTA_H_
2+
#define _WLAND_OTA_H_
3+
#include "wland_types.h"
4+
#include "rda_ccfg_api.h"
5+
6+
extern u32 flash_size;
7+
8+
#define CRC32_TABLE_ADDR 0xbb5c
9+
#define CRC32_ADDR 0x8dff//u32 crc32(const u8 *p, size_t len)
10+
11+
#define CRC32_TABLE_ADDR_4 0xbbd8
12+
#define CRC32_ADDR_4 0x8e33//u32 crc32(const u8 *p, size_t len)
13+
14+
static inline unsigned int bootrom_crc32(unsigned char *p, unsigned int len)
15+
{
16+
unsigned int func = CRC32_ADDR;
17+
if (rda_ccfg_hwver() >= 4) {
18+
func = CRC32_ADDR_4;
19+
}
20+
return ((unsigned int(*)(unsigned char *, unsigned int))func)(p, len);
21+
}
22+
23+
#endif /*_WLAND_OTA_H_*/

sdk/4.13/include/lwip/dhcp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050
#endif
5151

5252
/** period (in seconds) of the application calling dhcp_coarse_tmr() */
53-
#define DHCP_COARSE_TIMER_SECS 15
53+
#define DHCP_COARSE_TIMER_SECS 5
5454
/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */
5555
#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL)
5656
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */

sdk/4.13/libs/libLPBX3Kernel.a

6.51 KB
Binary file not shown.

0 commit comments

Comments
 (0)