Compare commits
2 Commits
79dbd5db5d
...
9bb66a9459
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bb66a9459 | |||
| aa9935ef22 |
@@ -11,6 +11,8 @@
|
|||||||
RadoMmm for suggesting an improvement on the ADC-to-Volts conversion
|
RadoMmm for suggesting an improvement on the ADC-to-Volts conversion
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define DEBUGLOG_DEFAULT_LOG_LEVEL_DEBUG
|
||||||
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include "ADS1256.h"
|
#include "ADS1256.h"
|
||||||
#include "SPI.h"
|
#include "SPI.h"
|
||||||
@@ -62,16 +64,16 @@ ADS1256::ADS1256(const int8_t DRDY_pin, const int8_t RESET_pin, const int8_t SYN
|
|||||||
|
|
||||||
updateConversionParameter();
|
updateConversionParameter();
|
||||||
|
|
||||||
// m_drdyHigh = xSemaphoreCreateBinary();
|
m_drdyHigh = xSemaphoreCreateBinary();
|
||||||
// m_drdyLow = xSemaphoreCreateBinary();
|
m_drdyLow = xSemaphoreCreateBinary();
|
||||||
// if (!m_drdyHigh || !m_drdyLow) {
|
if (!m_drdyHigh || !m_drdyLow) {
|
||||||
// LOG_ERROR("ADC Unable to create interrupt semaphores");
|
LOG_ERROR("ADC Unable to create interrupt semaphores");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// xSemaphoreGive(m_drdyHigh);
|
xSemaphoreGive(m_drdyHigh);
|
||||||
// xSemaphoreGive(m_drdyLow);
|
xSemaphoreGive(m_drdyLow);
|
||||||
//attachInterruptArg(DRDY_pin, drdyCallback, (void *)this, CHANGE);
|
attachInterruptArg(DRDY_pin, drdyCallback, (void *)this, CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
@@ -125,16 +127,16 @@ void ADS1256::InitializeADC()
|
|||||||
|
|
||||||
void ADS1256::waitForLowDRDY()
|
void ADS1256::waitForLowDRDY()
|
||||||
{
|
{
|
||||||
while(digitalRead(m_DRDY_pin) == HIGH) {vTaskDelay(1);};
|
// while(digitalRead(m_DRDY_pin) == HIGH) {vTaskDelay(1);};
|
||||||
// xSemaphoreTake(m_drdyLow, pdMS_TO_TICKS(10));
|
xSemaphoreTake(m_drdyLow, pdMS_TO_TICKS(10));
|
||||||
// xSemaphoreGive(m_drdyLow);
|
xSemaphoreGive(m_drdyLow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADS1256::waitForHighDRDY()
|
void ADS1256::waitForHighDRDY()
|
||||||
{
|
{
|
||||||
while(digitalRead(m_DRDY_pin) == LOW) {vTaskDelay(1);};
|
// while(digitalRead(m_DRDY_pin) == LOW) {vTaskDelay(1);};
|
||||||
// xSemaphoreTake(m_drdyHigh, pdMS_TO_TICKS(10));
|
xSemaphoreTake(m_drdyHigh, pdMS_TO_TICKS(10));
|
||||||
// xSemaphoreGive(m_drdyHigh);
|
xSemaphoreGive(m_drdyHigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADS1256::stopConversion() // Sending SDATAC to stop the continuous conversion
|
void ADS1256::stopConversion() // Sending SDATAC to stop the continuous conversion
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ lib_deps =
|
|||||||
me-no-dev/AsyncTCP@^3.3.2
|
me-no-dev/AsyncTCP@^3.3.2
|
||||||
me-no-dev/ESPAsyncWebServer@^3.6.0
|
me-no-dev/ESPAsyncWebServer@^3.6.0
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
upload_port = /dev/ttyACM1
|
upload_port = /dev/ttyACM0
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
monitor_port = /dev/ttyACM0
|
monitor_port = /dev/ttyACM1
|
||||||
monitor_speed = 921600
|
monitor_speed = 921600
|
||||||
build_type = release
|
build_type = release
|
||||||
build_flags =
|
build_flags =
|
||||||
@@ -45,9 +45,9 @@ framework = ${env:esp32-s3-devkitc1-n16r8.framework}
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${env:esp32-s3-devkitc1-n16r8.lib_deps}
|
${env:esp32-s3-devkitc1-n16r8.lib_deps}
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
upload_port = /dev/ttyACM1
|
upload_port = /dev/ttyACM0
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
monitor_port = /dev/ttyACM0
|
monitor_port = /dev/ttyACM1
|
||||||
monitor_speed = 921600
|
monitor_speed = 921600
|
||||||
debug_tool = esp-builtin
|
debug_tool = esp-builtin
|
||||||
debug_speed = 15000
|
debug_speed = 15000
|
||||||
|
|||||||
Reference in New Issue
Block a user