mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Added yield() inside the for-loops as well
This commit is contained in:
parent
da253b25bc
commit
c8b7c9a018
1 changed files with 6 additions and 0 deletions
|
@ -88,6 +88,9 @@ void setup() {
|
||||||
uint8_t tmpbyte;
|
uint8_t tmpbyte;
|
||||||
E_Notify(PSTR("\r\nGPIO test. Connect GPIN0 to GPOUT7, GPIN1 to GPOUT6, and so on"), 0x80);
|
E_Notify(PSTR("\r\nGPIO test. Connect GPIN0 to GPOUT7, GPIN1 to GPOUT6, and so on"), 0x80);
|
||||||
for(uint8_t sample_gpio = 0; sample_gpio < 255; sample_gpio++) {
|
for(uint8_t sample_gpio = 0; sample_gpio < 255; sample_gpio++) {
|
||||||
|
#ifdef ESP8266
|
||||||
|
yield(); // needed in order to reset the watchdog timer on the ESP8266
|
||||||
|
#endif
|
||||||
Usb.gpioWr(sample_gpio);
|
Usb.gpioWr(sample_gpio);
|
||||||
tmpbyte = Usb.gpioRd();
|
tmpbyte = Usb.gpioRd();
|
||||||
/* bit reversing code copied vetbatim from http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious */
|
/* bit reversing code copied vetbatim from http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious */
|
||||||
|
@ -115,6 +118,9 @@ void setup() {
|
||||||
/* Restart oscillator */
|
/* Restart oscillator */
|
||||||
E_Notify(PSTR("\r\nResetting oscillator\r\n"), 0x80);
|
E_Notify(PSTR("\r\nResetting oscillator\r\n"), 0x80);
|
||||||
for(uint16_t i = 0; i < 100; i++) {
|
for(uint16_t i = 0; i < 100; i++) {
|
||||||
|
#ifdef ESP8266
|
||||||
|
yield(); // needed in order to reset the watchdog timer on the ESP8266
|
||||||
|
#endif
|
||||||
E_Notify(PSTR("\rReset number "), 0x80);
|
E_Notify(PSTR("\rReset number "), 0x80);
|
||||||
Serial.print(i, DEC);
|
Serial.print(i, DEC);
|
||||||
Usb.regWr(rUSBCTL, bmCHIPRES); //reset
|
Usb.regWr(rUSBCTL, bmCHIPRES); //reset
|
||||||
|
|
Loading…
Reference in a new issue