Merge branch 'fix/cpp-linkage-mcpwm-example_v6.0' into 'release/v6.0'

fix(examples): add C++ linkage guards to MCPWM FOC SVPWM headers (v6.0)

See merge request espressif/esp-idf!52478
This commit is contained in:
morris
2026-09-07 10:07:22 +08:00
2 changed files with 20 additions and 0 deletions

View File

@@ -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

View File

@@ -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