diff --git a/Arduino_package/hardware/boards.txt b/Arduino_package/hardware/boards.txt index 6d7b40b9..6e8bf7f9 100644 --- a/Arduino_package/hardware/boards.txt +++ b/Arduino_package/hardware/boards.txt @@ -18,7 +18,7 @@ Ameba_AMB21_AMB22.build.f_cpu=200000000L Ameba_AMB21_AMB22.build.usb_product="AMB21" Ameba_AMB21_AMB22.build.board=AMEBA Ameba_AMB21_AMB22.build.core=ambd -Ameba_AMB21_AMB22.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB21_AMB22 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB21_AMB22.build.extra_flags=-mthumb -DCORE_RTL8722DM -DCORE_RTL8722CSM -DBOARD_AMB21_AMB22 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB21_AMB22.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld Ameba_AMB21_AMB22.build.variant=rtl8722dm @@ -43,9 +43,9 @@ Ameba_AMB21_AMB22.menu.EraseFlash.Enable.upload.erase_flash=Enable #Ameba_AMB21_AMB22.menu.AutoUploadMode.Enable.upload.auto_mode=Enable Ameba_AMB21_AMB22.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Ameba_AMB21_AMB22.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB21_AMB22 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB21_AMB22.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8722DM -DCORE_RTL8722CSM -DBOARD_AMB21_AMB22 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB21_AMB22.menu.StdLibInit.Disable=Disable -Ameba_AMB21_AMB22.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB21_AMB22 {build.usb_flags} +Ameba_AMB21_AMB22.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8722DM -DCORE_RTL8722CSM -DBOARD_AMB21_AMB22 {build.usb_flags} Ameba_AMB21_AMB22.menu.UploadBaudrate.1500000=1500000 Ameba_AMB21_AMB22.menu.UploadBaudrate.1500000.upload.speed=1500000 @@ -63,7 +63,7 @@ Ameba_AMB23.build.f_cpu=200000000L Ameba_AMB23.build.usb_product="AMB23" Ameba_AMB23.build.board=AMEBA Ameba_AMB23.build.core=ambd -Ameba_AMB23.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB23 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB23.build.extra_flags=-mthumb -DCORE_RTL8722DM -DBOARD_AMB23 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB23.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld Ameba_AMB23.build.variant=rtl8722dm_mini @@ -88,9 +88,9 @@ Ameba_AMB23.menu.EraseFlash.Enable.upload.erase_flash=Enable #Ameba_AMB23.menu.AutoUploadMode.Enable.upload.auto_mode=Enable Ameba_AMB23.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Ameba_AMB23.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB23 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB23.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8722DM -DBOARD_AMB23 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB23.menu.StdLibInit.Disable=Disable -Ameba_AMB23.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB23 {build.usb_flags} +Ameba_AMB23.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8722DM -DBOARD_AMB23 {build.usb_flags} Ameba_AMB23.menu.UploadBaudrate.1500000=1500000 Ameba_AMB23.menu.UploadBaudrate.1500000.upload.speed=1500000 @@ -108,7 +108,7 @@ Ai-Thinker_BW16.build.f_cpu=200000000L Ai-Thinker_BW16.build.usb_product="BW16" Ai-Thinker_BW16.build.board=AMEBA Ai-Thinker_BW16.build.core=ambd -Ai-Thinker_BW16.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AITHINKER_BW16 {build.usb_flags} -DArduino_STD_PRINTF +Ai-Thinker_BW16.build.extra_flags=-mthumb -DCORE_RTL8720DN -DBOARD_AITHINKER_BW16 {build.usb_flags} -DArduino_STD_PRINTF Ai-Thinker_BW16.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld Ai-Thinker_BW16.build.variant=rtl8720dn_bw16 @@ -133,9 +133,9 @@ Ai-Thinker_BW16.menu.AutoUploadMode.Enable=Enable Ai-Thinker_BW16.menu.AutoUploadMode.Enable.upload.auto_mode=Enable Ai-Thinker_BW16.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Ai-Thinker_BW16.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AITHINKER_BW16 {build.usb_flags} -DArduino_STD_PRINTF +Ai-Thinker_BW16.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8720DN -DBOARD_AITHINKER_BW16 {build.usb_flags} -DArduino_STD_PRINTF Ai-Thinker_BW16.menu.StdLibInit.Disable=Disable -Ai-Thinker_BW16.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AITHINKER_BW16 {build.usb_flags} +Ai-Thinker_BW16.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8720DN -DBOARD_AITHINKER_BW16 {build.usb_flags} Ai-Thinker_BW16.menu.UploadBaudrate.1500000=1500000 Ai-Thinker_BW16.menu.UploadBaudrate.1500000.upload.speed=1500000 @@ -153,7 +153,7 @@ SparkFun_ThingPlus-AWCU488.build.f_cpu=200000000L SparkFun_ThingPlus-AWCU488.build.usb_product="AW-CU488_ThingPlus" SparkFun_ThingPlus-AWCU488.build.board=AMEBA SparkFun_ThingPlus-AWCU488.build.core=ambd -SparkFun_ThingPlus-AWCU488.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_AWCU488 {build.usb_flags} -DArduino_STD_PRINTF +SparkFun_ThingPlus-AWCU488.build.extra_flags=-mthumb -DCORE_RTL8721DM -DBOARD_SPARKFUN_AWCU488 {build.usb_flags} -DArduino_STD_PRINTF SparkFun_ThingPlus-AWCU488.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld SparkFun_ThingPlus-AWCU488.build.variant=sparkfun_thingplus-awcu488 @@ -178,9 +178,9 @@ SparkFun_ThingPlus-AWCU488.menu.AutoUploadMode.Enable=Enable SparkFun_ThingPlus-AWCU488.menu.AutoUploadMode.Enable.upload.auto_mode=Enable SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Enable=Arduino_STD_PRINTF -SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_AWCU488 {build.usb_flags} -DArduino_STD_PRINTF +SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8721DM -DBOARD_SPARKFUN_AWCU488 {build.usb_flags} -DArduino_STD_PRINTF SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Disable=Disable -SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_AWCU488 {build.usb_flags} +SparkFun_ThingPlus-AWCU488.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8721DM -DBOARD_SPARKFUN_AWCU488 {build.usb_flags} SparkFun_ThingPlus-AWCU488.menu.UploadBaudrate.1500000=1500000 SparkFun_ThingPlus-AWCU488.menu.UploadBaudrate.1500000.upload.speed=1500000 @@ -198,7 +198,7 @@ Ameba_AMB25.build.f_cpu=200000000L Ameba_AMB25.build.usb_product="AMB25" Ameba_AMB25.build.board=AMEBA Ameba_AMB25.build.core=ambd -Ameba_AMB25.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB25 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB25.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_AMB25 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB25.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld Ameba_AMB25.build.variant=ameba_amb25_amb26 @@ -223,9 +223,9 @@ Ameba_AMB25.menu.AutoUploadMode.Enable=Enable Ameba_AMB25.menu.AutoUploadMode.Enable.upload.auto_mode=Enable Ameba_AMB25.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Ameba_AMB25.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB25 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB25.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_AMB25 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB25.menu.StdLibInit.Disable=Disable -Ameba_AMB25.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB25 {build.usb_flags} +Ameba_AMB25.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_AMB25 {build.usb_flags} Ameba_AMB25.menu.UploadBaudrate.1500000=1500000 Ameba_AMB25.menu.UploadBaudrate.1500000.upload.speed=1500000 @@ -243,7 +243,7 @@ Ameba_AMB26.build.f_cpu=200000000L Ameba_AMB26.build.usb_product="AMB26" Ameba_AMB26.build.board=AMEBA Ameba_AMB26.build.core=ambd -Ameba_AMB26.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB26 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB26.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_AMB26 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB26.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld Ameba_AMB26.build.variant=ameba_amb25_amb26 @@ -268,9 +268,9 @@ Ameba_AMB26.menu.AutoUploadMode.Enable=Enable Ameba_AMB26.menu.AutoUploadMode.Enable.upload.auto_mode=Enable Ameba_AMB26.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Ameba_AMB26.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB26 {build.usb_flags} -DArduino_STD_PRINTF +Ameba_AMB26.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_AMB26 {build.usb_flags} -DArduino_STD_PRINTF Ameba_AMB26.menu.StdLibInit.Disable=Disable -Ameba_AMB26.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_AMB26 {build.usb_flags} +Ameba_AMB26.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_AMB26 {build.usb_flags} Ameba_AMB26.menu.UploadBaudrate.1500000=1500000 Ameba_AMB26.menu.UploadBaudrate.1500000.upload.speed=1500000 @@ -286,7 +286,7 @@ u-blox_NORA-W30.build.f_cpu=200000000L u-blox_NORA-W30.build.usb_product="u-blox_NORA-W30" u-blox_NORA-W30.build.board=AMEBA u-blox_NORA-W30.build.core=ambd -u-blox_NORA-W30.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_UBLOX_NORAW30 {build.usb_flags} -DArduino_STD_PRINTF +u-blox_NORA-W30.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_UBLOX_NORAW30 {build.usb_flags} -DArduino_STD_PRINTF u-blox_NORA-W30.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld u-blox_NORA-W30.build.variant=u-blox_nora-w30 @@ -311,11 +311,9 @@ u-blox_NORA-W30.menu.AutoUploadMode.Enable=Enable u-blox_NORA-W30.menu.AutoUploadMode.Enable.upload.auto_mode=Enable u-blox_NORA-W30.menu.StdLibInit.Enable=Arduino_STD_PRINTF -u-blox_NORA-W30.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_UBLOX_NORAW30 {build.usb_flags} -DArduino_STD_PRINTF +u-blox_NORA-W30.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_UBLOX_NORAW30 {build.usb_flags} -DArduino_STD_PRINTF u-blox_NORA-W30.menu.StdLibInit.Disable=Disable -u-blox_NORA-W30.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_UBLOX_NORAW30 {build.usb_flags} -u-blox_NORA-W30.menu.StdLibInit.Enable=Arduino_STD_PRINTF -u-blox_NORA-W30.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_UBLOX_NORAW30 {build.usb_flags} -DArduino_STD_PRINTF +u-blox_NORA-W30.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_UBLOX_NORAW30 {build.usb_flags} u-blox_NORA-W30.menu.UploadBaudrate.921600=921600 u-blox_NORA-W30.menu.UploadBaudrate.921600.upload.speed=921600 @@ -331,7 +329,7 @@ Sparkfun_ThingPlus-NORA-W306.build.f_cpu=200000000L Sparkfun_ThingPlus-NORA-W306.build.usb_product="Sparkfun_ThingPlus-NORA-W306" Sparkfun_ThingPlus-NORA-W306.build.board=SPARKFUN_THINGPLUS_NORAW306 Sparkfun_ThingPlus-NORA-W306.build.core=ambd -Sparkfun_ThingPlus-NORA-W306.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} -DArduino_STD_PRINTF +Sparkfun_ThingPlus-NORA-W306.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} -DArduino_STD_PRINTF Sparkfun_ThingPlus-NORA-W306.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld Sparkfun_ThingPlus-NORA-W306.build.variant=sparkfun_thingplus-nora-w306 @@ -356,11 +354,9 @@ Sparkfun_ThingPlus-NORA-W306.menu.AutoUploadMode.Disable=Disable Sparkfun_ThingPlus-NORA-W306.menu.AutoUploadMode.Disable.upload.auto_mode=Disable Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} -DArduino_STD_PRINTF +Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} -DArduino_STD_PRINTF Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Disable=Disable -Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} -Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Enable=Arduino_STD_PRINTF -Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} -DArduino_STD_PRINTF +Sparkfun_ThingPlus-NORA-W306.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_SPARKFUN_NORAW306 {build.usb_flags} Sparkfun_ThingPlus-NORA-W306.menu.UploadBaudrate.921600=921600 Sparkfun_ThingPlus-NORA-W306.menu.UploadBaudrate.921600.upload.speed=921600 @@ -376,7 +372,7 @@ DataloggerIot.build.f_cpu=200000000L DataloggerIot.build.usb_product="Datalogger Iot" DataloggerIot.build.board=AMEBA DataloggerIot.build.core=ambd -DataloggerIot.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_DATALOGGER_AMB26 {build.usb_flags} -DArduino_STD_PRINTF +DataloggerIot.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_DATALOGGER_AMB26 {build.usb_flags} -DArduino_STD_PRINTF DataloggerIot.build.ldscript=linker_scripts/gcc/amebad_img2_is_arduino.ld DataloggerIot.build.variant=Datalogger_AMB26 @@ -401,11 +397,9 @@ DataloggerIot.menu.AutoUploadMode.Enable=Enable DataloggerIot.menu.AutoUploadMode.Enable.upload.auto_mode=Enable DataloggerIot.menu.StdLibInit.Enable=Arduino_STD_PRINTF -DataloggerIot.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_DATALOGGER_AMB26 {build.usb_flags} -DArduino_STD_PRINTF +DataloggerIot.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_DATALOGGER_AMB26 {build.usb_flags} -DArduino_STD_PRINTF DataloggerIot.menu.StdLibInit.Disable=Disable -DataloggerIot.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_DATALOGGER_AMB26 {build.usb_flags} -DataloggerIot.menu.StdLibInit.Enable=Arduino_STD_PRINTF -DataloggerIot.menu.StdLibInit.Enable.build.extra_flags=-mthumb -DRTL8722DM -DBOARD_DATALOGGER_AMB26 {build.usb_flags} -DArduino_STD_PRINTF +DataloggerIot.menu.StdLibInit.Disable.build.extra_flags=-mthumb -DCORE_RTL8720DF -DBOARD_DATALOGGER_AMB26 {build.usb_flags} DataloggerIot.menu.UploadBaudrate.921600=921600 DataloggerIot.menu.UploadBaudrate.921600.upload.speed=921600 diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/BasicInputOutput/BasicInputOutput.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/BasicInputOutput/BasicInputOutput.ino index bcdd9760..06f6b464 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/BasicInputOutput/BasicInputOutput.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/BasicInputOutput/BasicInputOutput.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-basic/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "AudioCodec.h" #define SAMPLECOUNT 512 @@ -26,3 +29,11 @@ void loop() { vol = map(vol, 0, 1024, 0, 100); Codec.setOutputVolume(vol, vol); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/FFT/FFT.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/FFT/FFT.ino index e60057e3..18415323 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/FFT/FFT.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/FFT/FFT.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-fft/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "FFT.h" #define SAMPLERATE 16000 @@ -43,3 +46,12 @@ void setup() { void loop() { delay(1); } + +#else + +void setup() {} + +void loop() {} + +#endif + diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/InputFFT/InputFFT.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/InputFFT/InputFFT.ino index e22878cc..98a9de50 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/InputFFT/InputFFT.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/InputFFT/InputFFT.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-inputfft/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "AudioCodec.h" #include "FFT.h" @@ -48,3 +51,11 @@ void loop() { } delay(1); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/OutputSineWave/OutputSineWave.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/OutputSineWave/OutputSineWave.ino index c70d5593..5863c04f 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/OutputSineWave/OutputSineWave.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/OutputSineWave/OutputSineWave.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-sinewave/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "AudioCodec.h" #define SAMPLERATE 16000 @@ -31,3 +34,11 @@ void loop() { } delay(1); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/PlaybackWavFile/PlaybackWavFile.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/PlaybackWavFile/PlaybackWavFile.ino index c5c0e9d5..49dfac09 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/PlaybackWavFile/PlaybackWavFile.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/PlaybackWavFile/PlaybackWavFile.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-wav/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "FatFs_SD.h" #include "PlaybackWav.h" #include "AudioCodec.h" @@ -48,3 +51,11 @@ void loop() { delay(100); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/RecordPlaybackWav/RecordPlaybackWav.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/RecordPlaybackWav/RecordPlaybackWav.ino index 8400dd70..2976c63d 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/RecordPlaybackWav/RecordPlaybackWav.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/RecordPlaybackWav/RecordPlaybackWav.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-wav/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "FatFs_SD.h" #include "PlaybackWav.h" #include "RecordWav.h" @@ -68,3 +71,11 @@ void loop() { } delay(100); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/AudioCodec/examples/RecordWavFile/RecordWavFile.ino b/Arduino_package/hardware/libraries/AudioCodec/examples/RecordWavFile/RecordWavFile.ino index 33430c3f..c92caaaf 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/examples/RecordWavFile/RecordWavFile.ino +++ b/Arduino_package/hardware/libraries/AudioCodec/examples/RecordWavFile/RecordWavFile.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-wav/ */ +// AudioCodec is not supported on core RTL8720DN nor RTL8720DF. +#if !defined(CORE_RTL8720DF) && !defined(CORE_RTL8720DN) + #include "FatFs_SD.h" #include "RecordWav.h" #include "AudioCodec.h" @@ -53,3 +56,11 @@ void loop() { } delay(100); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp b/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp index c0988849..b81b6519 100644 --- a/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp +++ b/Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp @@ -1,8 +1,9 @@ #include "AudioCodec.h" -#if defined(BOARD_RTL8720DN_BW16) || defined(BOARD_RTL8720DF) -#error Sorry, AudioCodec is not supported on RTL8720DN and RTL8720DF. -#endif +#if defined(BOARD_AITHINKER_BW16) || defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) +// error Sorry, AudioCodec is not supported on RTL8720DN and RTL8720DF. + +#else #ifdef __cplusplus extern "C" { @@ -619,3 +620,5 @@ void AudioCodec::rxCompleteHandler(void* DMAinfo) { rx_length = getFreeRxLength(); AUDIO_SP_RXGDMA_Restart(GDMA_InitStruct->GDMA_Index, GDMA_InitStruct->GDMA_ChNum, rx_addr, rx_length); } + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/examples/create_folder/create_folder.ino b/Arduino_package/hardware/libraries/FatfsSDIO/examples/create_folder/create_folder.ino index 14b1006b..f055c938 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/examples/create_folder/create_folder.ino +++ b/Arduino_package/hardware/libraries/FatfsSDIO/examples/create_folder/create_folder.ino @@ -5,6 +5,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-fatfssdio/ */ +// Core RTL8720DN do not support SDIO. Please use SPI interface for SD card +#ifndef CORE_RTL8720DN + #include "FatFs_SD.h" char dirname[] = "testdir"; @@ -46,3 +49,11 @@ void setup() { void loop() { delay(1000); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/examples/file_read_write/file_read_write.ino b/Arduino_package/hardware/libraries/FatfsSDIO/examples/file_read_write/file_read_write.ino index a0fa7742..7b683f5d 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/examples/file_read_write/file_read_write.ino +++ b/Arduino_package/hardware/libraries/FatfsSDIO/examples/file_read_write/file_read_write.ino @@ -5,6 +5,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-fatfssdio/ */ +// Core RTL8720DN do not support SDIO. Please use SPI interface for SD card +#ifndef CORE_RTL8720DN + #include "FatFs_SD.h" char filename[] = "test.txt"; @@ -44,3 +47,11 @@ void setup() { void loop() { delay(1000); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/examples/get_file_attribute/get_file_attribute.ino b/Arduino_package/hardware/libraries/FatfsSDIO/examples/get_file_attribute/get_file_attribute.ino index e698cef9..646eb8c1 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/examples/get_file_attribute/get_file_attribute.ino +++ b/Arduino_package/hardware/libraries/FatfsSDIO/examples/get_file_attribute/get_file_attribute.ino @@ -5,6 +5,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-fatfssdio/ */ +// Core RTL8720DN do not support SDIO. Please use SPI interface for SD card +#ifndef CORE_RTL8720DN + #include "FatFs_SD.h" FatFsSD fs; @@ -41,3 +44,11 @@ void loop() { // put your main code here, to run repeatedly: delay(1000); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/examples/last_modified_time/last_modified_time.ino b/Arduino_package/hardware/libraries/FatfsSDIO/examples/last_modified_time/last_modified_time.ino index d2e27ea8..840a2ee2 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/examples/last_modified_time/last_modified_time.ino +++ b/Arduino_package/hardware/libraries/FatfsSDIO/examples/last_modified_time/last_modified_time.ino @@ -5,6 +5,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-fatfssdio/ */ +// Core RTL8720DN do not support SDIO. Please use SPI interface for SD card +#ifndef CORE_RTL8720DN + #include FatFsSD fs; @@ -39,3 +42,11 @@ void setup() { void loop() { delay(1000); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/examples/list_root_files/list_root_files.ino b/Arduino_package/hardware/libraries/FatfsSDIO/examples/list_root_files/list_root_files.ino index 1fe41f1c..0d97d874 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/examples/list_root_files/list_root_files.ino +++ b/Arduino_package/hardware/libraries/FatfsSDIO/examples/list_root_files/list_root_files.ino @@ -5,6 +5,9 @@ https://www.amebaiot.com/en/amebad-arduino-audio-fatfssdio/ */ +// Core RTL8720DN do not support SDIO. Please use SPI interface for SD card +#ifndef CORE_RTL8720DN + #include "FatFs_SD.h" FatFsSD fs; @@ -34,3 +37,11 @@ void setup() { void loop() { delay(1000); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/examples/read_html_from_SD_card/read_html_from_SD_card.ino b/Arduino_package/hardware/libraries/FatfsSDIO/examples/read_html_from_SD_card/read_html_from_SD_card.ino index a19ebc21..2090cc3b 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/examples/read_html_from_SD_card/read_html_from_SD_card.ino +++ b/Arduino_package/hardware/libraries/FatfsSDIO/examples/read_html_from_SD_card/read_html_from_SD_card.ino @@ -5,6 +5,9 @@ https://www.amebaiot.com/en/amebad-arduino-fatfs-sdio/ */ +// Core RTL8720DN do not support SDIO. Please use SPI interface for SD card +#ifndef CORE_RTL8720DN + #include #include "FatFs_SD.h" @@ -107,3 +110,11 @@ void printWifiStatus() { Serial.print("To see this page in action, open a browser to http://"); Serial.println(ip); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/FatfsSDIO/src/FatFs_SD.cpp b/Arduino_package/hardware/libraries/FatfsSDIO/src/FatFs_SD.cpp index cec960f2..f42b9193 100644 --- a/Arduino_package/hardware/libraries/FatfsSDIO/src/FatFs_SD.cpp +++ b/Arduino_package/hardware/libraries/FatfsSDIO/src/FatFs_SD.cpp @@ -11,9 +11,9 @@ extern "C" { } #endif -#if defined(BOARD_RTL8720DN_BW16) -#error RTL8720DN/BW16 do not support SDIO. Please use SPI interface for SD card. -#endif +#if defined(BOARD_AITHINKER_BW16) +// #error RTL8720DN/BW16 do not support SDIO. Please use SPI interface for SD card. +#else #define TEST_SIZE (512) @@ -349,3 +349,5 @@ int FatFsSD::getAttribute(char *absolute_path, unsigned char *attr) { return -ret; } + +#endif diff --git a/Arduino_package/hardware/libraries/MQTTClient/src/PubSubClient.h b/Arduino_package/hardware/libraries/MQTTClient/src/PubSubClient.h index 20aa5ffa..873eb439 100644 --- a/Arduino_package/hardware/libraries/MQTTClient/src/PubSubClient.h +++ b/Arduino_package/hardware/libraries/MQTTClient/src/PubSubClient.h @@ -21,7 +21,7 @@ #define MQTT_VERSION MQTT_VERSION_3_1_1 #endif -#ifdef RTL8722DM +#if defined (CORE_RTL8722DM) || (CORE_RTL8720DN) || (CORE_RTL8721DM) || (CORE_RTL8720DF) // PCNs (Patch Change Numbers) /* For projects (Ex. LASS) that needs larger packets size then default. */ diff --git a/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp b/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp index 9fac1ac0..7dc5d55e 100644 --- a/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp +++ b/Arduino_package/hardware/libraries/PowerSave/src/PowerSave.cpp @@ -1,4 +1,3 @@ - #ifdef __cplusplus extern "C" { #include "ameba_soc.h" @@ -365,7 +364,7 @@ void PMUClass::AON_WAKEPIN_WAKEUP_PA26(void) { printf("Set Deepsleep wakeup AON pin PA26 / pin 8. \r\n"); } -#elif defined(BOARD_RTL8721DM) +#elif defined(BOARD_SPARKFUN_AWCU488) void PMUClass::AON_WAKEPIN_WAKEUP_PA12(void) { printf("Set Deepsleep wakeup AON pin PA12 / pin 4. \r\n"); } @@ -391,10 +390,10 @@ void PMUClass::AON_WAKEPIN_WAKEUP_PA19(void) { printf("Set Deepsleep wakeup AON pin PA19 / pin 8. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA20(void) { - printf("BOARD_RTL8721DM does not support Deepsleep wakeup AON pin PA20. \r\n"); + printf("BOARD_SPARKFUN_AWCU488 does not support Deepsleep wakeup AON pin PA20. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA21(void) { - printf("BOARD_RTL8721DM does not support Deepsleep wakeup AON pin PA21. \r\n"); + printf("BOARD_SPARKFUN_AWCU488 does not support Deepsleep wakeup AON pin PA21. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA25(void) { printf("Set Deepsleep wakeup AON pin PA25 / pin 6. \r\n"); @@ -403,7 +402,7 @@ void PMUClass::AON_WAKEPIN_WAKEUP_PA26(void) { printf("Set Deepsleep wakeup AON pin PA26 / pin 5. \r\n"); } -#elif defined(BOARD_AMB25) || (BOARD_AMB26) +#elif defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) void PMUClass::AON_WAKEPIN_WAKEUP_PA12(void) { printf("Set Deepsleep wakeup AON pin PA12 / pin 3. \r\n"); } @@ -417,22 +416,22 @@ void PMUClass::AON_WAKEPIN_WAKEUP_PA15(void) { printf("Set Deepsleep wakeup AON pin PA15 / pin 0. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA16(void) { - printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA16. \r\n"); + printf("RTL8720DF does not support Deepsleep wakeup AON pin PA16. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA17(void) { - printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA17. \r\n"); + printf("RTL8720DF does not support Deepsleep wakeup AON pin PA17. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA18(void) { - printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA18. \r\n"); + printf("RTL8720DF does not support Deepsleep wakeup AON pin PA18. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA19(void) { - printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA19. \r\n"); + printf("RTL8720DF does not support Deepsleep wakeup AON pin PA19. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA20(void) { - printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA20. \r\n"); + printf("RTL8720DF does not support Deepsleep wakeup AON pin PA20. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA21(void) { - printf("BOARD_RTL8720DF does not support Deepsleep wakeup AON pin PA21. \r\n"); + printf("RTL8720DF does not support Deepsleep wakeup AON pin PA21. \r\n"); } void PMUClass::AON_WAKEPIN_WAKEUP_PA25(void) { printf("Set Deepsleep wakeup AON pin PA25 / pin 7. \r\n"); diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino index d4945790..4709328a 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/Adafruit_GPS_parsing/Adafruit_GPS_parsing.ino @@ -26,15 +26,15 @@ // Connect the GPS TX (transmit) pin to Digital 0 // Connect the GPS RX (receive) pin to Digital 1 -#if defined(BOARD_RTL8722DM) +#if defined(BOARD_AMB21_AMB22) SoftwareSerial mySerial(0, 1); // RX, TX -#elif defined(BOARD_RTL8722DM_MINI) +#elif defined(BOARD_AMB23) SoftwareSerial mySerial(2, 1); // RX,TX -#elif defined(BOARD_RTL8720DN_BW16) +#elif defined(BOARD_AITHINKER_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX -#elif defined(BOARD_RTL8721DM) +#elif defined(BOARD_SPARKFUN_AWCU488) SoftwareSerial mySerial(3, 4); // RX, TX -#elif defined(BOARD_RTL8720DF) +#elif defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino index 11e7187a..351add08 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/PMS3003_AirQuality/PMS3003_AirQuality.ino @@ -13,21 +13,21 @@ In this example, we only use Serial to get PM 2.5 value. - The circuit: (BOARD RTL8722CSM / DM) - * RX is digital pin 0 (connect to PMS 3003 TX) - * TX is digital pin 1 (connect to PMS 3003 RX) - (BOARD RTL8722DM_MINI) - * RX is digital pin 2 (connect to PMS 3003 TX) - * TX is digital pin 1 (connect to PMS 3003 RX) - (BOARD RTL8720DN / BW16) - * RX is digital pin PB2 (connect to PMS 3003 TX) - * TX is digital pin PB1 (connect to PMS 3003 RX) - (BOARD RTL8721DM) - * RX is digital pin 3 (connect to PMS 3003 TX) - * TX is digital pin 4 (connect to PMS 3003 RX) - (BOARD RTL8720DF) - * RX is digital pin 17 (Connect to PMS 3003 TX) - * TX is digital pin 16 (Connect to PMS 3003 RX) + The circuit: (BOARD_AMB21_AMB22) + * RX is digital pin 0 (connect to the other device TX) + * TX is digital pin 1 (connect to the other device RX) + (BOARD_AMB23) + * RX is digital pin 2 (connect to the other device TX) + * TX is digital pin 1 (connect to the other device RX) + (BOARD_AITHINKER_BW16) + * RX is digital pin PB2 (connect to the other device TX) + * TX is digital pin PB1 (connect to the other device RX) + (BOARD_SPARKFUN_AWCU488) + * RX is digital pin 3 (connect to the other device TX) + * TX is digital pin 4 (connect to the other device RX) + (BOARD_AMB25, BOARD_AMB26) + * RX is digital pin 17 (connect to the other device TX) + * TX is digital pin 16 (connect to the other device RX) Example guide: https://www.amebaiot.com/en/amebad-arduino-pm25/ @@ -35,15 +35,15 @@ #include -#if defined(BOARD_RTL8722DM) +#if defined(BOARD_AMB21_AMB22) SoftwareSerial mySerial(0, 1); // RX, TX -#elif defined(BOARD_RTL8722DM_MINI) +#elif defined(BOARD_AMB23) SoftwareSerial mySerial(2, 1); // RX, TX -#elif defined(BOARD_RTL8720DN_BW16) +#elif defined(BOARD_AITHINKER_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX -#elif defined(BOARD_RTL8721DM) +#elif defined(BOARD_SPARKFUN_AWCU488) SoftwareSerial mySerial(3, 4); // RX, TX -#elif defined(BOARD_RTL8720DF) +#elif defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino index 55df2187..c6d20563 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_Basic/SoftwareSerial_Basic.ino @@ -3,19 +3,19 @@ Receives from serial RX, and then sends to serial TX - The circuit: (BOARD RTL8722CSM / DM) + The circuit: (BOARD_AMB21_AMB22) * RX is digital pin 0 (connect to the other device TX) * TX is digital pin 1 (connect to the other device RX) - (BOARD RTL8722DM_MINI) + (BOARD_AMB23) * RX is digital pin 2 (connect to the other device TX) * TX is digital pin 1 (connect to the other device RX) - (BOARD RTL8720DN / BW16) + (BOARD_AITHINKER_BW16) * RX is digital pin PB2 (connect to the other device TX) * TX is digital pin PB1 (connect to the other device RX) - (BOARD RTL8721DM) + (BOARD_SPARKFUN_AWCU488) * RX is digital pin 3 (connect to the other device TX) * TX is digital pin 4 (connect to the other device RX) - (BOARD RTL8720DF) + (BOARD_AMB25, BOARD_AMB26) * RX is digital pin 17 (connect to the other device TX) * TX is digital pin 16 (connect to the other device RX) @@ -25,15 +25,15 @@ #include -#if defined(BOARD_RTL8722DM) +#if defined(BOARD_AMB21_AMB22) SoftwareSerial mySerial(0, 1); // RX, TX -#elif defined(BOARD_RTL8722DM_MINI) +#elif defined(BOARD_AMB23) SoftwareSerial mySerial(2, 1); // RX, TX -#elif defined(BOARD_RTL8720DN_BW16) +#elif defined(BOARD_AITHINKER_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX -#elif defined(BOARD_RTL8721DM) +#elif defined(BOARD_SPARKFUN_AWCU488) SoftwareSerial mySerial(3, 4); // RX, TX -#elif defined(BOARD_RTL8720DF) +#elif defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino index 94bf099e..a079c49c 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_DetailSetting/SoftwareSerial_DetailSetting.ino @@ -4,31 +4,31 @@ Receives from serial RX, and then sends to serial TX baud rate: 38400, data bits: 7, parity: even, 1 stop bit, with RTS/CTS - The circuit: (BOARD RTL8722CSM / DM) + The circuit: (BOARD_AMB21_AMB22) * RX is digital pin 0 (connect to the other device TX) * TX is digital pin 1 (connect to the other device RX) * RTS is pin PA_14 (connect to the other device CTS) * CTS is pin PA_15 (connect to the other device RTS) - The circuit: (BOARD RTL8722DM_MINI) + The circuit: (BOARD_AMB23) * RX is digital pin 2 (connect to the other device TX) * TX is digital pin 1 (connect to the other device RX) * RTS is pin PA_14 (connect to the other device CTS) * CTS is pin PA_15 (connect to the other device RTS) - The circuit: (BOARD RTL8720DN/BW16) + The circuit: (BOARD_AITHINKER_BW16) * RX is digital pin PB2 (connect to the other device TX) * TX is digital pin PB1 (connect to the other device RX) * RTS is pin PA_14 (connect to the other device CTS) * CTS is pin PA_15 (connect to the other device RTS) -The circuit: (BOARD RTL8721DM) +The circuit: (BOARD_SPARKFUN_AWCU488) * RX is digital pin 3 (connect to the other device TX) * TX is digital pin 4 (connect to the other device RX) * RTS is pin PA_14 (connect to the other device CTS) * CTS is pin PA_15 (connect to the other device RTS) -The circuit: (BOARD RTL8720DF) +The circuit: (BOARD_AMB25, BOARD_AMB26) * RX is digital pin 17 (connect to the other device TX) * TX is digital pin 16 (connect to the other device RX) * RTS is pin PB_21 (connect to the other device CTS) @@ -42,15 +42,15 @@ The circuit: (BOARD RTL8720DF) #define RTS_PIN PA_14 #define CTS_PIN PA_15 -#if defined(BOARD_RTL8722DM) +#if defined(BOARD_AMB21_AMB22) SoftwareSerial mySerial(0, 1); // RX, TX -#elif defined(BOARD_RTL8722DM_MINI) +#elif defined(BOARD_AMB23) SoftwareSerial mySerial(2, 1); // RX, TX -#elif defined(BOARD_RTL8720DN_BW16) +#elif defined(BOARD_AITHINKER_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX -#elif defined(BOARD_RTL8721DM) +#elif defined(BOARD_SPARKFUN_AWCU488) SoftwareSerial mySerial(3, 4); // RX, TX -#elif defined(BOARD_RTL8720DF) +#elif defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX diff --git a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino index 3b9aedef..64ac9223 100644 --- a/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino +++ b/Arduino_package/hardware/libraries/SoftwareSerial/examples/SoftwareSerial_IRQ_Callback/SoftwareSerial_IRQ_Callback.ino @@ -8,19 +8,19 @@ To test this sketch, you need type something on software serial and then press Enter. - The circuit: (BOARD RTL8722CSM / DM) + The circuit: (BOARD_AMB21_AMB22) * RX is digital pin 0 (connect to the other device TX) * TX is digital pin 1 (connect to the other device RX) - (BOARD RTL8722DM_MINI) + (BOARD_AMB23) * RX is digital pin 2 (connect to the other device TX) * TX is digital pin 1 (connect to the other device RX) - (BOARD RTL8720DN / BW16) + (BOARD_AITHINKER_BW16) * RX is digital pin PB2 (connect to the other device TX) * TX is digital pin PB1 (connect to the other device RX) - (BOARD RTL8721DM) + (BOARD_SPARKFUN_AWCU488) * RX is digital pin 3 (connect to the other device TX) * TX is digital pin 4 (connect to the other device RX) - (BOARD RTL8720DF) + (BOARD_AMB25, BOARD_AMB26) * RX is digital pin 17 (connect to the other device TX) * TX is digital pin 16 (connect to the other device RX) @@ -30,15 +30,15 @@ #include -#if defined(BOARD_RTL8722DM) +#if defined(BOARD_AMB21_AMB22) SoftwareSerial mySerial(0, 1); // RX, TX -#elif defined(BOARD_RTL8722DM_MINI) +#elif defined(BOARD_AMB23) SoftwareSerial mySerial(2, 1); // RX,TX -#elif defined(BOARD_RTL8720DN_BW16) +#elif defined(BOARD_AITHINKER_BW16) SoftwareSerial mySerial(PB2, PB1); // RX, TX -#elif defined(BOARD_RTL8721DM) +#elif defined(BOARD_SPARKFUN_AWCU488) SoftwareSerial mySerial(3, 4); // RX, TX -#elif defined(BOARD_RTL8720DF) +#elif defined(BOARD_AMB25) || defined(BOARD_AMB26) || defined(BOARD_UBLOX_NORAW30) || defined(BOARD_SPARKFUN_NORAW306) || defined(BOARD_DATALOGGER_AMB26) SoftwareSerial mySerial(17, 16); // RX, TX #else SoftwareSerial mySerial(0, 1); // RX, TX diff --git a/Arduino_package/hardware/libraries/USB/examples/USBCDCSerial/USBCDCSerial.ino b/Arduino_package/hardware/libraries/USB/examples/USBCDCSerial/USBCDCSerial.ino index 38c416ac..95131257 100644 --- a/Arduino_package/hardware/libraries/USB/examples/USBCDCSerial/USBCDCSerial.ino +++ b/Arduino_package/hardware/libraries/USB/examples/USBCDCSerial/USBCDCSerial.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-usb-cdc/ */ +// USB functionality is not supported on core RTL8720DN +#ifndef CORE_RTL8720DN + #include "USBCDCDevice.h" void setup() { @@ -22,3 +25,11 @@ void loop() { } delay(1); } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/USB/examples/USBHIDGamepad/USBHIDGamepad.ino b/Arduino_package/hardware/libraries/USB/examples/USBHIDGamepad/USBHIDGamepad.ino index 347741d2..bb7bde22 100644 --- a/Arduino_package/hardware/libraries/USB/examples/USBHIDGamepad/USBHIDGamepad.ino +++ b/Arduino_package/hardware/libraries/USB/examples/USBHIDGamepad/USBHIDGamepad.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-usb-gamepad/ */ +// USB functionality is not supported on core RTL8720DN +#ifndef CORE_RTL8720DN + #include "USBHIDDevice.h" #include "USBHIDGamepad.h" @@ -45,3 +48,11 @@ void loop() { delay(500); } } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/USB/examples/USBHIDKeyboard/USBHIDKeyboard.ino b/Arduino_package/hardware/libraries/USB/examples/USBHIDKeyboard/USBHIDKeyboard.ino index 29ec1229..645bc6be 100644 --- a/Arduino_package/hardware/libraries/USB/examples/USBHIDKeyboard/USBHIDKeyboard.ino +++ b/Arduino_package/hardware/libraries/USB/examples/USBHIDKeyboard/USBHIDKeyboard.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-usb-keyboard/ */ +// USB functionality is not supported on core RTL8720DN +#ifndef CORE_RTL8720DN + #include "USBHIDDevice.h" #include "USBHIDKeyboard.h" @@ -37,3 +40,11 @@ void loop() { delay(500); } } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/USB/examples/USBHIDMouse/USBHIDMouse.ino b/Arduino_package/hardware/libraries/USB/examples/USBHIDMouse/USBHIDMouse.ino index 4d4b0a36..bf020c28 100644 --- a/Arduino_package/hardware/libraries/USB/examples/USBHIDMouse/USBHIDMouse.ino +++ b/Arduino_package/hardware/libraries/USB/examples/USBHIDMouse/USBHIDMouse.ino @@ -4,6 +4,9 @@ https://www.amebaiot.com/en/amebad-arduino-usb-mouse/ */ +// USB functionality is not supported on core RTL8720DN +#ifndef CORE_RTL8720DN + #include "USBHIDDevice.h" #include "USBHIDMouse.h" @@ -50,3 +53,11 @@ void loop() { delay(500); } } + +#else + +void setup() {} + +void loop() {} + +#endif diff --git a/Arduino_package/hardware/libraries/USB/src/USBCDCDevice.h b/Arduino_package/hardware/libraries/USB/src/USBCDCDevice.h index 8f9d46c1..d9363aaf 100644 --- a/Arduino_package/hardware/libraries/USB/src/USBCDCDevice.h +++ b/Arduino_package/hardware/libraries/USB/src/USBCDCDevice.h @@ -1,9 +1,9 @@ #ifndef _USB_CDCDEVICE_H_ #define _USB_CDCDEVICE_H_ -#ifdef BOARD_RTL8720DN_BW16 - #error "USB functionality is not supported on BW16 development board" -#endif +#ifdef BOARD_AITHINKER_BW16 +// error "USB functionality is not supported on BW16 development board" +#else #include @@ -89,3 +89,5 @@ extern USBCDCDevice SerialUSB; #endif +#endif + diff --git a/Arduino_package/hardware/libraries/USB/src/USBHIDDevice.h b/Arduino_package/hardware/libraries/USB/src/USBHIDDevice.h index 2cccd078..f51a4846 100644 --- a/Arduino_package/hardware/libraries/USB/src/USBHIDDevice.h +++ b/Arduino_package/hardware/libraries/USB/src/USBHIDDevice.h @@ -1,9 +1,9 @@ #ifndef _USB_HIDDEVICE_H_ #define _USB_HIDDEVICE_H_ -#ifdef BOARD_RTL8720DN_BW16 - #error "USB functionality is not supported on BW16 development board" -#endif +#ifdef BOARD_AITHINKER_BW16 +// #error "USB functionality is not supported on BW16 development board" +#else #include #include "HID.h" @@ -20,7 +20,7 @@ extern "C" { #endif // Endpoint address -#define HID_INTERRUPT_IN_EP_ADDRESS 0x81 +#define HID_INTERRUPT_IN_EP_ADDRESS 0x81 // Report ID should start with 1 #define REPORT_ID_KEYBOARD 1 @@ -86,3 +86,4 @@ extern USBHIDDevice USBHIDDev; #endif +#endif diff --git a/Arduino_package/hardware/libraries/WiFi/examples/UDP_Calculation/UDP_CalculateReceiveTimeout/UDP_CalculateReceiveTimeout.ino b/Arduino_package/hardware/libraries/WiFi/examples/UDP_Calculation/UDP_CalculateReceiveTimeout/UDP_CalculateReceiveTimeout.ino index abfe7c0c..a05c521c 100644 --- a/Arduino_package/hardware/libraries/WiFi/examples/UDP_Calculation/UDP_CalculateReceiveTimeout/UDP_CalculateReceiveTimeout.ino +++ b/Arduino_package/hardware/libraries/WiFi/examples/UDP_Calculation/UDP_CalculateReceiveTimeout/UDP_CalculateReceiveTimeout.ino @@ -78,5 +78,6 @@ void loop() { Serial.print(" Timeout: "); Serial.println(timeout); Udp.setRecvTimeout(timeout); + delay(10); // user may change the delay duration to match the computer sending speed } } diff --git a/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.cpp b/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.cpp index 496b3ea8..5632957b 100644 --- a/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.cpp +++ b/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.cpp @@ -22,8 +22,7 @@ WiFiClient::WiFiClient(): WiFiClient::WiFiClient(uint8_t sock) { _sock = sock; - // if ((sock >= 0) && (sock != 0xFF)) { - if (sock != 0xFF) { + if ((sock >= 0) && (sock != 0xFF)) { _is_connected = true; } recvTimeout = 3000; diff --git a/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.h b/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.h index 6e653d3a..b1a8c653 100644 --- a/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.h +++ b/Arduino_package/hardware/libraries/WiFi/src/WiFiClient.h @@ -46,7 +46,7 @@ class WiFiClient: public Client { using Print::write; private: - uint8_t _sock; + int8_t _sock; ServerDrv clientdrv; bool _is_connected; uint8_t data[DATA_LENTH];