diff --git a/src/.DS_Store b/src/.DS_Store index 06a362e..6c095b1 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/extras/PwmPin.cpp b/src/extras/PwmPin.cpp index e33902f..db0a7d9 100644 --- a/src/extras/PwmPin.cpp +++ b/src/extras/PwmPin.cpp @@ -22,7 +22,9 @@ LedC::LedC(uint8_t pin, uint16_t freq){ int res=LEDC_TIMER_BIT_MAX-1; // find the maximum possible resolution while(getApbFrequency()/(freq*pow(2,res))<1) - res--; + res--; + + Serial.println(getApbFrequency()/(freq*pow(2,res))); timerList[nTimer][nMode]->duty_resolution=(ledc_timer_bit_t)res; ledc_timer_config(timerList[nTimer][nMode]); @@ -191,9 +193,11 @@ ledc_timer_config_t *LedC::timerList[LEDC_TIMER_MAX][LEDC_SPEED_MODE_MAX]={}; //////////////////////////// -//******************************************************* -// DEPRECATED - INCLUDED FOR BACKWARDS COMPATIBILITY ONLY -//******************************************************* +//***************************************************************** +// DEPRECATED - INCLUDED FOR BACKWARDS COMPATIBILITY FOR ESP32 ONLY +//***************************************************************** + +#ifdef CONFIG_IDF_TARGET_ESP32 PwmPin::PwmPin(uint8_t channel, uint8_t pin){ this->channel=channel & 0x0F; @@ -283,3 +287,5 @@ void PwmPin::HSVtoRGB(float h, float s, float v, float *r, float *g, float *b ){ break; } } + +#endif diff --git a/src/extras/RFControl.cpp b/src/extras/RFControl.cpp index 0e5990a..5990831 100644 --- a/src/extras/RFControl.cpp +++ b/src/extras/RFControl.cpp @@ -15,7 +15,7 @@ RFControl::RFControl(int pin){ REG_SET_BIT(RMT_APB_CONF_REG,3); // enables access to RMT memory and enables wraparound mode (though the latter does not seem to be needed to set continuous TX) REG_WRITE(RMT_INT_ENA_REG,1<>8); +Serial.printf("DIV1: %d\n",REG_GET_FIELD(LEDC_LSTIMER1_CONF_REG,LEDC_CLK_DIV_LSTIMER1)>>8); +Serial.printf("DIV2: %d\n",REG_GET_FIELD(LEDC_LSTIMER2_CONF_REG,LEDC_CLK_DIV_LSTIMER2)>>8); + // uint32_t v=REG_READ(LEDC_HSTIMER0_CONF_REG); // Serial.printf("HS %d %d %d %d\n",(v>>25)&1,v&0x1f,(v>>13)&0x3FF,(v>>5)&0xFF);