Skip to content

Commit

Permalink
remove example's WIO_W600, add power_output_startup in arduino core main
Browse files Browse the repository at this point in the history
  • Loading branch information
baorepo committed Sep 25, 2019
1 parent 6148ebc commit b94d129
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 54 deletions.
12 changes: 11 additions & 1 deletion cores/w600/core_w600_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions libraries/DNS/examples/Dns/Dns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
#include <W600WiFi.h>
#include <Dns.h>

#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());
Expand Down Expand Up @@ -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();
Expand Down
10 changes: 0 additions & 10 deletions libraries/MsTimer/examples/MsTimer/MsTimer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,13 @@
#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)
{
printf("time1 callback!\r\n");
}

void setup() {
#ifdef WIO_W600
power_output_startup();
#endif
// put your setup code here, to run once:

/*Timers 测试*/
Expand Down
11 changes: 0 additions & 11 deletions libraries/SPI/examples/SPI/SPI.ino
Original file line number Diff line number Diff line change
@@ -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();
}

Expand Down
11 changes: 0 additions & 11 deletions libraries/W600WiFi/examples/LED-AP/LED-AP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
10 changes: 0 additions & 10 deletions libraries/Wire/examples/i2c_AT24CXX/i2c_AT24CXX.ino
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#include <Arduino.h>
#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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b94d129

Please sign in to comment.