mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(examples): add C++ linkage guards to mcpwm foc svpwm example headers
Closes https://github.com/espressif/esp-idf/issues/19031
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <math.h>
|
||||
|
||||
// Use IQ18 type, range [-8,192 8,191.999 996 185]
|
||||
@@ -10,6 +12,10 @@
|
||||
#define GLOBAL_IQ 18
|
||||
#include "IQmathLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// 3-phase uvw coord data type
|
||||
typedef struct foc_uvw_coord {
|
||||
_iq u; // U phase data in IQ type
|
||||
@@ -70,3 +76,7 @@ void foc_inverse_park_transform(_iq theta_rad, const foc_dq_coord_t *v_dq, foc_a
|
||||
* @param out_uvw[out] output modulated pwm duty in IQ type
|
||||
*/
|
||||
void foc_svpwm_duty_calculate(const foc_ab_coord_t *v_ab, foc_uvw_coord_t *out_uvw);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4,8 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "driver/mcpwm_prelude.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief svpwm inverter config struct type
|
||||
*/
|
||||
@@ -78,3 +84,7 @@ esp_err_t svpwm_inverter_set_duty(inverter_handle_t handle, uint16_t u, uint16_t
|
||||
* - ESP_ERR_INVALID_ARG: NULL arguments
|
||||
*/
|
||||
esp_err_t svpwm_del_inverter(inverter_handle_t handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user