diff --git a/README.pdf b/README.pdf index 35a23ddb..876e427f 100644 Binary files a/README.pdf and b/README.pdf differ diff --git "a/docs/UM3101-RT-Thread-W60X-SDK \345\274\200\345\217\221\346\211\213\345\206\214.pdf" "b/docs/UM3101-RT-Thread-W60X-SDK \345\274\200\345\217\221\346\211\213\345\206\214.pdf" index ce00df73..41fd8e74 100644 Binary files "a/docs/UM3101-RT-Thread-W60X-SDK \345\274\200\345\217\221\346\211\213\345\206\214.pdf" and "b/docs/UM3101-RT-Thread-W60X-SDK \345\274\200\345\217\221\346\211\213\345\206\214.pdf" differ diff --git "a/docs/UM3102-RT-Thread-W60X-SDK \344\273\213\347\273\215.pdf" "b/docs/UM3102-RT-Thread-W60X-SDK \344\273\213\347\273\215.pdf" index 1e8f687f..ec51c906 100644 Binary files "a/docs/UM3102-RT-Thread-W60X-SDK \344\273\213\347\273\215.pdf" and "b/docs/UM3102-RT-Thread-W60X-SDK \344\273\213\347\273\215.pdf" differ diff --git "a/docs/UM3103-RT-Thread-W60X-SDK \345\277\253\351\200\237\344\270\212\346\211\213.pdf" "b/docs/UM3103-RT-Thread-W60X-SDK \345\277\253\351\200\237\344\270\212\346\211\213.pdf" index 15f3b9c4..8e05d1eb 100644 Binary files "a/docs/UM3103-RT-Thread-W60X-SDK \345\277\253\351\200\237\344\270\212\346\211\213.pdf" and "b/docs/UM3103-RT-Thread-W60X-SDK \345\277\253\351\200\237\344\270\212\346\211\213.pdf" differ diff --git "a/docs/UM3104-RT-Thread-W60X-SDK \345\217\221\345\270\203\350\257\264\346\230\216.pdf" "b/docs/UM3104-RT-Thread-W60X-SDK \345\217\221\345\270\203\350\257\264\346\230\216.pdf" index 15db361d..f0dbb90d 100644 Binary files "a/docs/UM3104-RT-Thread-W60X-SDK \345\217\221\345\270\203\350\257\264\346\230\216.pdf" and "b/docs/UM3104-RT-Thread-W60X-SDK \345\217\221\345\270\203\350\257\264\346\230\216.pdf" differ diff --git "a/docs/UM3105-RT-Thread-W60X-SDK-\351\200\232\350\277\207\344\270\262\345\217\243\347\203\247\345\275\225W60X \350\212\257\347\211\207\345\233\272\344\273\266.pdf" "b/docs/UM3105-RT-Thread-W60X-SDK-\351\200\232\350\277\207\344\270\262\345\217\243\347\203\247\345\275\225W60X \350\212\257\347\211\207\345\233\272\344\273\266.pdf" index 26102793..985051dc 100644 Binary files "a/docs/UM3105-RT-Thread-W60X-SDK-\351\200\232\350\277\207\344\270\262\345\217\243\347\203\247\345\275\225W60X \350\212\257\347\211\207\345\233\272\344\273\266.pdf" and "b/docs/UM3105-RT-Thread-W60X-SDK-\351\200\232\350\277\207\344\270\262\345\217\243\347\203\247\345\275\225W60X \350\212\257\347\211\207\345\233\272\344\273\266.pdf" differ diff --git "a/docs/UM3106-RT-Thread-\345\237\272\344\272\216W600 \350\212\257\347\211\207\347\232\204\344\276\213\347\250\213\344\275\277\347\224\250\350\257\264\346\230\216.pdf" "b/docs/UM3106-RT-Thread-\345\237\272\344\272\216W600 \350\212\257\347\211\207\347\232\204\344\276\213\347\250\213\344\275\277\347\224\250\350\257\264\346\230\216.pdf" index 851ec2b3..a2b63163 100644 Binary files "a/docs/UM3106-RT-Thread-\345\237\272\344\272\216W600 \350\212\257\347\211\207\347\232\204\344\276\213\347\250\213\344\275\277\347\224\250\350\257\264\346\230\216.pdf" and "b/docs/UM3106-RT-Thread-\345\237\272\344\272\216W600 \350\212\257\347\211\207\347\232\204\344\276\213\347\250\213\344\275\277\347\224\250\350\257\264\346\230\216.pdf" differ diff --git a/docs/figures/hardware/W60x_HW_origin.png b/docs/figures/hardware/W60x_HW_origin.png index a9f42a24..3cde1821 100644 Binary files a/docs/figures/hardware/W60x_HW_origin.png and b/docs/figures/hardware/W60x_HW_origin.png differ diff --git a/examples/15_component_micropython/packages/micropython-v1.10.1/port/genhdr/qstrdefs.generated.h b/examples/15_component_micropython/packages/micropython-v1.10.1/port/genhdr/qstrdefs.generated.h index 7e3cd31c..c4465de6 100644 --- a/examples/15_component_micropython/packages/micropython-v1.10.1/port/genhdr/qstrdefs.generated.h +++ b/examples/15_component_micropython/packages/micropython-v1.10.1/port/genhdr/qstrdefs.generated.h @@ -764,4 +764,5 @@ QDEF(MP_QSTR_period, (const byte*)"\xa0\x06" "period") QDEF(MP_QSTR_set_color, (const byte*)"\x25\x09" "set_color") QDEF(MP_QSTR_file_crc32, (const byte*)"\x6f\x0a" "file_crc32") QDEF(MP_QSTR_list_device, (const byte*)"\x20\x0b" "list_device") +QDEF(MP_QSTR_show_image, (const byte*)"\xde\x0a" "show_image") // This file was automatically generated by makeqstrdata.py diff --git a/examples/15_component_micropython/packages/micropython-v1.10.1/port/modules/machine/machine_lcd.c b/examples/15_component_micropython/packages/micropython-v1.10.1/port/modules/machine/machine_lcd.c index 8ea3f54d..1562750f 100644 --- a/examples/15_component_micropython/packages/micropython-v1.10.1/port/modules/machine/machine_lcd.c +++ b/examples/15_component_micropython/packages/micropython-v1.10.1/port/modules/machine/machine_lcd.c @@ -189,6 +189,30 @@ STATIC mp_obj_t machine_lcd_set_color(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lcd_set_color_obj, 3, 3, machine_lcd_set_color); +/// \method show_image array +/// +/// display the image on the lcd.. +/// @param x x position +/// @param y y position +/// @param length length of image +/// @param wide wide of image +/// @param p image_array +STATIC mp_obj_t machine_lcd_show_image(size_t n_args, const mp_obj_t *args) { + rt_uint16_t x = mp_obj_get_int(args[1]); + rt_uint16_t y = mp_obj_get_int(args[2]); + rt_uint16_t length = mp_obj_get_int(args[3]); + rt_uint16_t wide = mp_obj_get_int(args[4]); + + mp_buffer_info_t bufinfo; + if (mp_get_buffer(args[5], &bufinfo, MP_BUFFER_READ)) + { + lcd_show_image( x, y, length, wide, (const rt_uint8_t *)bufinfo.buf); + } + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lcd_show_image_obj, 6, 6, machine_lcd_show_image); + STATIC const mp_rom_map_elem_t machine_lcd_locals_dict_table[] = { // instance methods { MP_ROM_QSTR(MP_QSTR_light), MP_ROM_PTR(&machine_lcd_light_obj) }, @@ -199,6 +223,7 @@ STATIC const mp_rom_map_elem_t machine_lcd_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_rectangle), MP_ROM_PTR(&machine_lcd_rectangle_obj) }, { MP_ROM_QSTR(MP_QSTR_circle), MP_ROM_PTR(&machine_lcd_circle_obj) }, { MP_ROM_QSTR(MP_QSTR_set_color), MP_ROM_PTR(&machine_lcd_set_color_obj) }, + { MP_ROM_QSTR(MP_QSTR_show_image), MP_ROM_PTR(&machine_lcd_show_image_obj) }, // color { MP_ROM_QSTR(MP_QSTR_WHITE), MP_ROM_INT(WHITE) }, { MP_ROM_QSTR(MP_QSTR_BLACK), MP_ROM_INT(BLACK) }, diff --git a/examples/21_iot_mqtt/README.md b/examples/21_iot_mqtt/README.md index e3f47b8b..419aac21 100644 --- a/examples/21_iot_mqtt/README.md +++ b/examples/21_iot_mqtt/README.md @@ -51,12 +51,6 @@ mq_publish() 函数用来向指定的主题发布消息。例程里的主题就 本例程的部分示例代码如下所示: ```c -#define MQTT_URI "tcp://iot.eclipse.org:1883" -#define MQTT_USERNAME "admin" -#define MQTT_PASSWORD "admin" -#define MQTT_SUBTOPIC "/mqtt/test" -#define MQTT_PUBTOPIC "/mqtt/test" - int main(void) { /* 配置 wifi 工作模式 */ @@ -154,36 +148,36 @@ static void mqtt_online_callback(MQTTClient *c) 按下复位按键重启开发板,开发板会自动连上 WiFi ,可以看到板子会打印出如下信息: ```shell - \ | / -- RT - Thread Operating System - / | \ 4.0.1 build Jun 3 2019 - 2006 - 2019 Copyright by rt-thread team -lwIP-2.0.2 initialized! -[SFUD] Find a Winbond flash chip. Size is 16777216 bytes. -[SFUD] w25q128 flash device is initialize success. -[I/sal.skt] Socket Abstraction Layer initialize success. -[I/WLAN.dev] wlan init success -[I/WLAN.lwip] eth device init ok name:w0 -[I/FAL] RT-Thread Flash Abstraction Layer (V0.3.0) initialize success. + \ | / +- RT - Thread Operating System + / | \ 4.0.2 build Sep 10 2019 + 2006 - 2019 Copyright by rt-thread team +lwIP-2.0.2 initialized! +[SFUD] Find a Winbond flash chip. Size is 16777216 bytes. +[SFUD] w25q128 flash device is initialize success. +[I/sal.skt] Socket Abstraction Layer initialize success. +[I/WLAN.dev] wlan init success +[I/WLAN.lwip] eth device init ok name:w0 +[I/FAL] RT-Thread Flash Abstraction Layer (V0.3.0) initialize success. [Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:152) ENV start address is 0x0000 -0000, size is 4096 bytes. -[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:821) Calculate ENV CRC32 number -is 0xD6363A94. -[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:833) Verify ENV CRC32 result is -OK. -[Flash] EasyFlash V3.3.0 is initialize success. -[Flash] You can get the latest version on https://github.com/armink/EasyFlash . -msh />[I/WLAN.mgnt] wifi connect success ssid:test -[D/main] Start mqtt client and subscribe topic:/mqtt/test/rtthread5125 #启动 MQTT 客户端 -[I/main] Start to connect mqtt server -[D/MQTT] ipv4 address port: 1883 -[D/MQTT] HOST = 'iot.eclipse.org' -[I/WLAN.lwip] Got IP address : 192.168.12.92 -[I/MQTT] MQTT server connect success -[I/MQTT] Subscribe #0 /mqtt/test/rtthread5125 OK! -[D/main] Connect mqtt server success -[D/main] Publish message: Hello,RT-Thread! to topic: /mqtt/test/rtthread5125 #发布消息 -[D/main] Topic: /mqtt/test/rtthread5125 receive a message: Hello,RT-Thread! #收到订阅消息 +0000, size is 4096 bytes. +[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:821) Calculate ENV CRC32 number +is 0xD6363A94. +[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:833) Verify ENV CRC32 result is +OK. +[Flash] EasyFlash V3.3.0 is initialize success. +[Flash] You can get the latest version on https://github.com/armink/EasyFlash . +msh />[I/WLAN.mgnt] wifi connect success ssid:test +[D/main] Start mqtt client and subscribe topic:/mqtt/test/rtthread5125 #启动 MQTT 客户端 +[I/main] Start to connect mqtt server +[D/MQTT] ipv4 address port: 1883 +[D/MQTT] HOST = 'mqtt.rt-thread.com' +[I/WLAN.lwip] Got IP address : 192.168.12.49 +[I/MQTT] MQTT server connect success +[I/MQTT] Subscribe #0 /mqtt/test/rtthread9660 OK! +[D/main] Connect mqtt server success +[D/main] Publish message: Hello,RT-Thread! to topic: /mqtt/test/rtthread9660 #发布消息 +[D/main] Topic: /mqtt/test/rtthread9660 receive a message: Hello,RT-Thread! #收到订阅消息 ``` 我们可以看到, WiFi 连接成功后,MQTT 客户端就自动连接了服务器,并订阅了我们指定的主题。连接服务器成功,处于在线状态后,发布了一条 Hello,RT-Thread! 的消息,我们很快接收到了服务器推送过来的这条消息。 diff --git a/examples/21_iot_mqtt/applications/main.c b/examples/21_iot_mqtt/applications/main.c index 371d2b24..1a494876 100644 --- a/examples/21_iot_mqtt/applications/main.c +++ b/examples/21_iot_mqtt/applications/main.c @@ -34,9 +34,10 @@ * tcp://[fe80::20c:29ff:fe9a:a07e]:1883 * ssl://[fe80::20c:29ff:fe9a:a07e]:1884 */ -#define MQTT_URI "tcp://iot.eclipse.org:1883" -#define MQTT_USERNAME "admin" -#define MQTT_PASSWORD "admin" + +#define MQTT_URI "tcp://mqtt.rt-thread.com:1883" +#define MQTT_USERNAME "test" +#define MQTT_PASSWORD "8C0E1DCCC041725E43A5D3666EFDE62E" #define MQTT_SUBTOPIC "/mqtt/test/" #define MQTT_PUBTOPIC "/mqtt/test/" diff --git a/examples/31_iot_cloud_rtt/project.uvoptx b/examples/31_iot_cloud_rtt/project.uvoptx index 111f5da0..2f5ce8a7 100644 --- a/examples/31_iot_cloud_rtt/project.uvoptx +++ b/examples/31_iot_cloud_rtt/project.uvoptx @@ -120,7 +120,7 @@ 0 JL2CM3 - -U20090928 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W600_QFlash -FS08000000 -FL0100000 + -U59400616 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W60X_QFlash -FS08000000 -FL0100000 0 diff --git a/examples/31_iot_cloud_rtt/template.uvoptx b/examples/31_iot_cloud_rtt/template.uvoptx index 111f5da0..2f5ce8a7 100644 --- a/examples/31_iot_cloud_rtt/template.uvoptx +++ b/examples/31_iot_cloud_rtt/template.uvoptx @@ -120,7 +120,7 @@ 0 JL2CM3 - -U20090928 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W600_QFlash -FS08000000 -FL0100000 + -U59400616 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W60X_QFlash -FS08000000 -FL0100000 0 diff --git a/rt-thread/components/drivers/wlan/wlan_mgnt.c b/rt-thread/components/drivers/wlan/wlan_mgnt.c index e0ee67e0..cf2204c6 100644 --- a/rt-thread/components/drivers/wlan/wlan_mgnt.c +++ b/rt-thread/components/drivers/wlan/wlan_mgnt.c @@ -260,7 +260,8 @@ static rt_err_t rt_wlan_send_to_thread(rt_wlan_event_t event, void *buff, int le msg->event = event; if (len != 0) { - msg->buff = ((char *)msg) + sizeof(struct rt_wlan_msg); + msg->buff = (void *)&msg[1]; + rt_memcpy(msg->buff, buff, len); msg->len = len; } diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index a74b07ae..00000000 --- a/tools/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/*.pyc diff --git a/tools/.gitkeep b/tools/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/update_fls.exe b/tools/update_fls.exe index 9edfe7b5..a6513772 100644 Binary files a/tools/update_fls.exe and b/tools/update_fls.exe differ