mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
sigmadelta: change gpio number from u8 to int
Fix the issue that macro compares unsigned to 0
This commit is contained in:
parent
29e9b5b46a
commit
bf677182a6
@ -10,11 +10,7 @@
|
|||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "esp_intr_alloc.h"
|
#include "esp_intr_alloc.h"
|
||||||
#if !CONFIG_IDF_TARGET_LINUX
|
|
||||||
#include "esp_attr.h"
|
|
||||||
#include "esp_types.h"
|
|
||||||
#include "soc/soc_caps.h"
|
#include "soc/soc_caps.h"
|
||||||
#endif // !CONFIG_IDF_TARGET_LINUX
|
|
||||||
#include "hal/gpio_types.h"
|
#include "hal/gpio_types.h"
|
||||||
#include "esp_rom_gpio.h"
|
#include "esp_rom_gpio.h"
|
||||||
|
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "esp_types.h"
|
#include <stdint.h>
|
||||||
|
#include "esp_err.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "hal/sigmadelta_types.h"
|
#include "hal/sigmadelta_types.h"
|
||||||
|
|
||||||
@ -18,10 +19,10 @@ extern "C" {
|
|||||||
* @brief Sigma-delta configure struct
|
* @brief Sigma-delta configure struct
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
sigmadelta_channel_t channel; /*!< Sigma-delta channel number */
|
sigmadelta_channel_t channel; /*!< Sigma-delta channel number */
|
||||||
int8_t sigmadelta_duty; /*!< Sigma-delta duty, duty ranges from -128 to 127. */
|
int8_t sigmadelta_duty; /*!< Sigma-delta duty, duty ranges from -128 to 127. */
|
||||||
uint8_t sigmadelta_prescale; /*!< Sigma-delta prescale, prescale ranges from 0 to 255. */
|
uint8_t sigmadelta_prescale; /*!< Sigma-delta prescale, prescale ranges from 0 to 255. */
|
||||||
uint8_t sigmadelta_gpio; /*!< Sigma-delta output io number, refer to gpio.h for more details. */
|
gpio_num_t sigmadelta_gpio; /*!< Sigma-delta output io number, refer to gpio.h for more details. */
|
||||||
} sigmadelta_config_t;
|
} sigmadelta_config_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "esp_attr.h"
|
||||||
#include "esp_private/pm_trace.h"
|
#include "esp_private/pm_trace.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "soc/ledc_struct.h"
|
#include "soc/ledc_struct.h"
|
||||||
#include "driver/gptimer.h"
|
#include "driver/gptimer.h"
|
||||||
#include "driver/ledc.h"
|
#include "driver/ledc.h"
|
||||||
|
#include "esp_attr.h"
|
||||||
#include "iot_led.h"
|
#include "iot_led.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user