From b94d129f6d873c3d314ffbe230a236b578a1d186 Mon Sep 17 00:00:00 2001 From: Baozhu Zuo Date: Wed, 25 Sep 2019 14:56:50 +0800 Subject: [PATCH] remove example's WIO_W600, add power_output_startup in arduino core main --- cores/w600/core_w600_main.cpp | 12 +++++++++++- libraries/DNS/examples/Dns/Dns.ino | 11 ----------- libraries/MsTimer/examples/MsTimer/MsTimer.ino | 10 ---------- libraries/SPI/examples/SPI/SPI.ino | 11 ----------- libraries/W600WiFi/examples/LED-AP/LED-AP.ino | 11 ----------- libraries/Wire/examples/i2c_AT24CXX/i2c_AT24CXX.ino | 10 ---------- 6 files changed, 11 insertions(+), 54 deletions(-) diff --git a/cores/w600/core_w600_main.cpp b/cores/w600/core_w600_main.cpp index 315225a..33b1fe0 100644 --- a/cores/w600/core_w600_main.cpp +++ b/cores/w600/core_w600_main.cpp @@ -17,10 +17,20 @@ void SystemInit() } #endif +#ifdef WIO_W600 +void power_output_startup() +{ + pinMode(PB_7, OUTPUT); + digitalWrite(PB_7, HIGH); +} +#endif + int user_main_task() { wm_swd_config(1); - +#ifdef WIO_W600 + power_output_startup(); +#endif setup(); while (1) diff --git a/libraries/DNS/examples/Dns/Dns.ino b/libraries/DNS/examples/Dns/Dns.ino index 1ee902b..ea2a9e9 100644 --- a/libraries/DNS/examples/Dns/Dns.ino +++ b/libraries/DNS/examples/Dns/Dns.ino @@ -2,14 +2,6 @@ #include #include -#ifdef WIO_W600 -int power_output_startup() -{ - pinMode(6, OUTPUT); - digitalWrite(6, HIGH); -} -#endif - int wifi_connect_as_sta() { printf("WiFi.mac: %s\n", WiFi.macAddressStr()); @@ -43,9 +35,6 @@ int wifi_connect_as_sta() void w600_arduino_setup() { -#ifdef WIO_W600 - power_output_startup(); -#endif printf("[%s %s %d]\n", __FILE__, __func__, __LINE__); Serial.println("xxxxxxxxxxxx"); //Serial1.begin(); diff --git a/libraries/MsTimer/examples/MsTimer/MsTimer.ino b/libraries/MsTimer/examples/MsTimer/MsTimer.ino index ee46be7..2edf557 100644 --- a/libraries/MsTimer/examples/MsTimer/MsTimer.ino +++ b/libraries/MsTimer/examples/MsTimer/MsTimer.ino @@ -4,13 +4,6 @@ #include "string.h" #include "stdio.h" -#ifdef WIO_W600 -int power_output_startup() -{ - pinMode(6, OUTPUT); - digitalWrite(6, HIGH); -} -#endif void time_test_f(void) { @@ -18,9 +11,6 @@ void time_test_f(void) } void setup() { -#ifdef WIO_W600 - power_output_startup(); -#endif // put your setup code here, to run once: /*Timers 测试*/ diff --git a/libraries/SPI/examples/SPI/SPI.ino b/libraries/SPI/examples/SPI/SPI.ino index 01a9d89..6a4be41 100644 --- a/libraries/SPI/examples/SPI/SPI.ino +++ b/libraries/SPI/examples/SPI/SPI.ino @@ -1,17 +1,6 @@ #include "SPI.h" -#ifdef WIO_W600 -int power_output_startup() -{ - pinMode(6, OUTPUT); - digitalWrite(6, HIGH); -} -#endif - void setup() { -#ifdef WIO_W600 - power_output_startup(); -#endif SPI.begin(); } diff --git a/libraries/W600WiFi/examples/LED-AP/LED-AP.ino b/libraries/W600WiFi/examples/LED-AP/LED-AP.ino index 2fd8670..034e7c9 100644 --- a/libraries/W600WiFi/examples/LED-AP/LED-AP.ino +++ b/libraries/W600WiFi/examples/LED-AP/LED-AP.ino @@ -8,14 +8,6 @@ #define USER_BUTTON_PAx_PBx_MACRO 0 #define USER_BUTTON_SW_MACRO 0 -#ifdef WIO_W600 -int power_output_startup() -{ - pinMode(6, OUTPUT); - digitalWrite(6, HIGH); -} -#endif - #if USE_LED_MACRO int led_red_pin = LED_RED; int led_green_pin = LED_GREEN; @@ -152,9 +144,6 @@ void w600_arduino_loop() } void setup() { -#ifdef WIO_W600 - power_output_startup(); -#endif printf("setup()\n"); // put your setup code here, to run once: w600_arduino_setup(); diff --git a/libraries/Wire/examples/i2c_AT24CXX/i2c_AT24CXX.ino b/libraries/Wire/examples/i2c_AT24CXX/i2c_AT24CXX.ino index 7aae7cb..b6f4693 100644 --- a/libraries/Wire/examples/i2c_AT24CXX/i2c_AT24CXX.ino +++ b/libraries/Wire/examples/i2c_AT24CXX/i2c_AT24CXX.ino @@ -1,13 +1,6 @@ #include #include "Wire.h" -#ifdef WIO_W600 -int power_output_startup() -{ - pinMode(6, OUTPUT); - digitalWrite(6, HIGH); -} -#endif static unsigned char AT24CXX_ReadOneByte(unsigned short addr) { @@ -43,9 +36,6 @@ unsigned char AT24CXX_Check(void) } void setup() { -#ifdef WIO_W600 - power_output_startup(); -#endif // put your setup code here, to run once: Wire.setClock(100000); Wire.begin(WM_IO_PB_14, WM_IO_PB_13);