mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-07 13:42:26 +00:00
ESP-IDF Robot Controls
This commit is contained in:
0
ESP-IDF_Robot/build/.ninja_lock
Normal file
0
ESP-IDF_Robot/build/.ninja_lock
Normal file
@@ -1 +1 @@
|
|||||||
ref: refs/heads/main
|
c9763f62dd00c887a1a8fafe388db868a7e44069
|
||||||
|
@@ -18,7 +18,7 @@ set(HEAD_HASH)
|
|||||||
file(READ "/home/abobkov/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/CMakeFiles/git-data/HEAD" HEAD_CONTENTS LIMIT 1024)
|
file(READ "/home/abobkov/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/CMakeFiles/git-data/HEAD" HEAD_CONTENTS LIMIT 1024)
|
||||||
|
|
||||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||||
set(GIT_DIR "/home/abobkov/MyProjects/ESP-Nodes/.git")
|
set(GIT_DIR "/home/abobkov/esp/esp-idf/.git")
|
||||||
# handle git-worktree
|
# handle git-worktree
|
||||||
if(EXISTS "${GIT_DIR}/commondir")
|
if(EXISTS "${GIT_DIR}/commondir")
|
||||||
file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024)
|
file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024)
|
||||||
|
@@ -1 +1 @@
|
|||||||
290a1d4dbd9f90d85fecf28da158154837556b89
|
c9763f62dd00c887a1a8fafe388db868a7e44069
|
||||||
|
@@ -806,30 +806,30 @@ void app_main(void)
|
|||||||
|
|
||||||
|
|
||||||
// ADC
|
// ADC
|
||||||
adc_ret = adc_continuous_read(handle, result, EXAMPLE_READ_LEN, &ret_num, 0);
|
adc_ret = adc_continuous_read(handle, result, READ_LEN, &ret_num, 0);
|
||||||
if (ret == ESP_OK) {
|
if (ret == ESP_OK) {
|
||||||
ESP_LOGI("TASK", "ret is %x, ret_num is %"PRIu32" bytes", ret, ret_num);
|
ESP_LOGI("TASK", "ret is %x, ret_num is %"PRIu32" bytes", ret, ret_num);
|
||||||
for (int i = 0; i < ret_num; i += SOC_ADC_DIGI_RESULT_BYTES) {
|
for (int i = 0; i < ret_num; i += SOC_ADC_DIGI_RESULT_BYTES) {
|
||||||
adc_digi_output_data_t *p = (adc_digi_output_data_t*)&result[i];
|
adc_digi_output_data_t *p = (adc_digi_output_data_t*)&result[i];
|
||||||
uint32_t chan_num = EXAMPLE_ADC_GET_CHANNEL(p);
|
uint32_t chan_num = ADC_GET_CHANNEL(p);
|
||||||
uint32_t data = EXAMPLE_ADC_GET_DATA(p);
|
uint32_t data = ADC_GET_DATA(p);
|
||||||
/* Check the channel number validation, the data is invalid if the channel num exceed the maximum channel */
|
/* Check the channel number validation, the data is invalid if the channel num exceed the maximum channel */
|
||||||
if (chan_num < SOC_ADC_CHANNEL_NUM(EXAMPLE_ADC_UNIT)) {
|
if (chan_num < SOC_ADC_CHANNEL_NUM(ADC_UNIT)) {
|
||||||
ESP_LOGI(TAG, "Unit: %s, Channel: %"PRIu32", Value: %"PRIx32, unit, chan_num, data);
|
ESP_LOGI(TAG, "Unit: %s, Channel: %"PRIu32", Value: %"PRIx32, unit, chan_num, data);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW(TAG, "Invalid data [%s_%"PRIu32"_%"PRIx32"]", unit, chan_num, data);
|
ESP_LOGW(TAG, "Invalid data [%s_%"PRIu32"_%"PRIx32"]", unit, chan_num, data);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Because printing is slow, so every time you call `ulTaskNotifyTake`, it will immediately return.
|
* Because printing is slow, so every time you call `ulTaskNotifyTake`, it will immediately return.
|
||||||
* To avoid a task watchdog timeout, add a delay here. When you replace the way you process the data,
|
* To avoid a task watchdog timeout, add a delay here. When you replace the way you process the data,
|
||||||
* usually you don't need this delay (as this task will block for a while).
|
* usually you don't need this delay (as this task will block for a while).
|
||||||
*/
|
*/
|
||||||
vTaskDelay(1);
|
vTaskDelay(1);
|
||||||
} else if (ret == ESP_ERR_TIMEOUT) {
|
} else if (ret == ESP_ERR_TIMEOUT) {
|
||||||
//We try to read `EXAMPLE_READ_LEN` until API returns timeout, which means there's no available data
|
//We try to read `EXAMPLE_READ_LEN` until API returns timeout, which means there's no available data
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS);
|
vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user