my esp8266 resets (probably) because i toggle some pins quite fast with this function:
Code: Select all
void pinHigh(uint32_t PIN){
gpio_output_set(0,0,0,PIN);
}
void pinLow(uint32_t PIN){
gpio_output_set(0,PIN,PIN,0);
}
void sendByte(uint8_t dataByte){
uint8_t initBitCounter;
for(initBitCounter = 7; initBitCounter >= 0; initBitCounter--){
uint8_t bitToWrite = (dataByte >> initBitCounter) & 1;
if(bitToWrite == 1){
pinHigh(SDI);
} else {
pinLow(SDI);
}
pinHigh(SCK);
os_delay_us(2);
pinLow(SCK);
}
}
I call the "sendByte" - function every second with a timer, the esp8266 resets every ~4 seconds. Why is that?