From 9fe76d3bca389642e71ac405c8343b280384276d Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Tue, 14 Dec 2021 13:34:39 +0800 Subject: [PATCH] Change all libdsp to libsx1262, preserve case --- libs/libsx1262/Kconfig | 22 ++++++++-------- libs/libsx1262/Makefile | 6 ++--- libs/libsx1262/README.txt | 8 +++--- libs/libsx1262/lib_foc.c | 38 +++++++++++++-------------- libs/libsx1262/lib_foc_b16.c | 38 +++++++++++++-------------- libs/libsx1262/lib_misc.c | 8 +++--- libs/libsx1262/lib_misc_b16.c | 8 +++--- libs/libsx1262/lib_motor.c | 38 +++++++++++++-------------- libs/libsx1262/lib_motor_b16.c | 34 ++++++++++++------------ libs/libsx1262/lib_observer.c | 40 ++++++++++++++--------------- libs/libsx1262/lib_pid.c | 18 ++++++------- libs/libsx1262/lib_pid_b16.c | 18 ++++++------- libs/libsx1262/lib_pmsm_model.c | 2 +- libs/libsx1262/lib_pmsm_model_b16.c | 2 +- libs/libsx1262/lib_svm.c | 12 ++++----- libs/libsx1262/lib_svm_b16.c | 12 ++++----- libs/libsx1262/lib_transform.c | 22 ++++++++-------- libs/libsx1262/lib_transform_b16.c | 22 ++++++++-------- 18 files changed, 173 insertions(+), 175 deletions(-) diff --git a/libs/libsx1262/Kconfig b/libs/libsx1262/Kconfig index 65bdaae86fa90..880da8ff071bd 100644 --- a/libs/libsx1262/Kconfig +++ b/libs/libsx1262/Kconfig @@ -3,35 +3,35 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -menuconfig LIBDSP +menuconfig LIBSX1262 bool "Digital Signal Processing Library" default n ---help--- Enable build for various DSP functions -if LIBDSP +if LIBSX1262 -config LIBDSP_DEBUG - bool "Libdsp debugging" +config LIBSX1262_DEBUG + bool "Libsx1262 debugging" default n ---help--- - Enable debugging for libdsp. This option enables additional parameters + Enable debugging for libsx1262. This option enables additional parameters checking. It can drastically reduce performance and be potentially dangerous to hardware, so it should be used carefully (probably only at an early stage of application development). -config LIBDSP_PRECISION - int "Libdsp precision [0/1/2]" +config LIBSX1262_PRECISION + int "Libsx1262 precision [0/1/2]" default 0 ---help--- - With this option we can select libdsp precision for + With this option we can select libsx1262 precision for some of calculations. There are 3 available options: 0 - the fastest calculation but the lowest precision, 1 - increased precision than for option 0 at the expense of a longer execution time, 2 - the most accuracte but the slowest one, use standard math functions. -config LIBDSP_FOC_VABC - bool "Libdsp FOC includes voltage abc frame" +config LIBSX1262_FOC_VABC + bool "Libsx1262 FOC includes voltage abc frame" -endif # LIBDSP +endif # LIBSX1262 diff --git a/libs/libsx1262/Makefile b/libs/libsx1262/Makefile index b308cfc50bea7..4152362d25005 100644 --- a/libs/libsx1262/Makefile +++ b/libs/libsx1262/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# libs/libdsp/Makefile +# libs/libsx1262/Makefile # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -20,7 +20,7 @@ include $(TOPDIR)/Make.defs -ifeq ($(CONFIG_LIBDSP),y) +ifeq ($(CONFIG_LIBSX1262),y) CSRCS += lib_pid.c CSRCS += lib_svm.c CSRCS += lib_transform.c @@ -45,7 +45,7 @@ COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) -BIN ?= libdsp$(LIBEXT) +BIN ?= libsx1262$(LIBEXT) all: $(BIN) .PHONY: depend clean distclean diff --git a/libs/libsx1262/README.txt b/libs/libsx1262/README.txt index 743203169038c..5a4b23328f563 100644 --- a/libs/libsx1262/README.txt +++ b/libs/libsx1262/README.txt @@ -1,6 +1,4 @@ -libdsp -====== +libsx1262 +========= -This directory contains various DSP functions. - -At the moment you will find here mainly functions related to BLDC/PMSM control. +This directory contains functions for Semtech SX1262 LoRa Transceiver. diff --git a/libs/libsx1262/lib_foc.c b/libs/libsx1262/lib_foc.c index 9f08b753d0e60..f90494d87e3e2 100644 --- a/libs/libsx1262/lib_foc.c +++ b/libs/libsx1262/lib_foc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_foc.c + * libs/libsx1262/lib_foc.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -52,8 +52,8 @@ static void foc_current_controller(FAR struct foc_data_f32_s *foc, FAR pid_controller_f32_t *id_pid = &foc->id_pid; FAR pid_controller_f32_t *iq_pid = &foc->iq_pid; - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(v_dq_req != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(v_dq_req != NULL); /* Get dq current error */ @@ -88,7 +88,7 @@ static void foc_current_controller(FAR struct foc_data_f32_s *foc, static void foc_vab_mod_scale_set(FAR struct foc_data_f32_s *foc, float scale) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); foc->vab_mod_scale = scale; } @@ -110,7 +110,7 @@ static void foc_vab_mod_scale_set(FAR struct foc_data_f32_s *foc, static void foc_vdq_mag_max_set(FAR struct foc_data_f32_s *foc, float max) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); foc->vdq_mag_max = max; @@ -138,8 +138,8 @@ static void foc_vdq_mag_max_set(FAR struct foc_data_f32_s *foc, float max) static void foc_vdq_ref_set(FAR struct foc_data_f32_s *foc, FAR dq_frame_f32_t *vdq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(vdq_ref != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(vdq_ref != NULL); foc->v_dq.d = vdq_ref->d; foc->v_dq.q = vdq_ref->q; @@ -163,8 +163,8 @@ static void foc_vdq_ref_set(FAR struct foc_data_f32_s *foc, static void foc_idq_ref_set(FAR struct foc_data_f32_s *foc, FAR dq_frame_f32_t *idq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(idq_ref != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(idq_ref != NULL); foc->i_dq_ref.d = idq_ref->d; foc->i_dq_ref.q = idq_ref->q; @@ -271,8 +271,8 @@ void foc_vbase_update(FAR struct foc_data_f32_s *foc, float vbase) void foc_angle_update(FAR struct foc_data_f32_s *foc, FAR phase_angle_f32_t *angle) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); /* Copy angle to foc data */ @@ -304,8 +304,8 @@ void foc_iabc_update(FAR struct foc_data_f32_s *foc, { dq_frame_f32_t i_dq; - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(i_abc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(i_abc != NULL); /* Reset data */ @@ -350,7 +350,7 @@ void foc_iabc_update(FAR struct foc_data_f32_s *foc, void foc_voltage_control(FAR struct foc_data_f32_s *foc, FAR dq_frame_f32_t *vdq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); /* Update VDQ request */ @@ -360,7 +360,7 @@ void foc_voltage_control(FAR struct foc_data_f32_s *foc, inv_park_transform(&foc->angle, &foc->v_dq, &foc->v_ab); -#ifdef CONFIG_LIBDSP_FOC_VABC +#ifdef CONFIG_LIBSX1262_FOC_VABC /* Inverse Clarke transform (voltage alpha-beta -> voltage abc) */ inv_clarke_transform(&foc->v_ab, &foc->v_abc); @@ -398,7 +398,7 @@ void foc_current_control(FAR struct foc_data_f32_s *foc, FAR dq_frame_f32_t *vdq_comp, FAR dq_frame_f32_t *vdq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); /* Update IDQ reference */ @@ -433,8 +433,8 @@ void foc_current_control(FAR struct foc_data_f32_s *foc, void foc_vabmod_get(FAR struct foc_data_f32_s *foc, FAR ab_frame_f32_t *v_ab_mod) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(v_ab_mod != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(v_ab_mod != NULL); v_ab_mod->a = foc->v_ab_mod.a; v_ab_mod->b = foc->v_ab_mod.b; @@ -457,7 +457,7 @@ void foc_vabmod_get(FAR struct foc_data_f32_s *foc, void foc_vdq_mag_max_get(FAR struct foc_data_f32_s *foc, FAR float *max) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); *max = foc->vdq_mag_max; } diff --git a/libs/libsx1262/lib_foc_b16.c b/libs/libsx1262/lib_foc_b16.c index 898fac65954c5..6f13d18b6e4d4 100644 --- a/libs/libsx1262/lib_foc_b16.c +++ b/libs/libsx1262/lib_foc_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_foc_b16.c + * libs/libsx1262/lib_foc_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -52,8 +52,8 @@ static void foc_current_controller_b16(FAR struct foc_data_b16_s *foc, FAR pid_controller_b16_t *id_pid = &foc->id_pid; FAR pid_controller_b16_t *iq_pid = &foc->iq_pid; - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(v_dq_req != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(v_dq_req != NULL); /* Get dq current error */ @@ -88,7 +88,7 @@ static void foc_current_controller_b16(FAR struct foc_data_b16_s *foc, static void foc_vab_mod_scale_set_b16(FAR struct foc_data_b16_s *foc, b16_t scale) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); foc->vab_mod_scale = scale; } @@ -111,7 +111,7 @@ static void foc_vab_mod_scale_set_b16(FAR struct foc_data_b16_s *foc, static void foc_vdq_mag_max_set_b16(FAR struct foc_data_b16_s *foc, b16_t max) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); foc->vdq_mag_max = max; @@ -139,8 +139,8 @@ static void foc_vdq_mag_max_set_b16(FAR struct foc_data_b16_s *foc, static void foc_vdq_ref_set_b16(FAR struct foc_data_b16_s *foc, FAR dq_frame_b16_t *vdq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(vdq_ref != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(vdq_ref != NULL); foc->v_dq.d = vdq_ref->d; foc->v_dq.q = vdq_ref->q; @@ -164,8 +164,8 @@ static void foc_vdq_ref_set_b16(FAR struct foc_data_b16_s *foc, static void foc_idq_ref_set_b16(FAR struct foc_data_b16_s *foc, FAR dq_frame_b16_t *idq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(idq_ref != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(idq_ref != NULL); foc->i_dq_ref.d = idq_ref->d; foc->i_dq_ref.q = idq_ref->q; @@ -272,8 +272,8 @@ void foc_vbase_update_b16(FAR struct foc_data_b16_s *foc, b16_t vbase) void foc_angle_update_b16(FAR struct foc_data_b16_s *foc, FAR phase_angle_b16_t *angle) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); /* Copy angle to foc data */ @@ -305,8 +305,8 @@ void foc_iabc_update_b16(FAR struct foc_data_b16_s *foc, { dq_frame_b16_t i_dq; - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(i_abc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(i_abc != NULL); /* Reset data */ @@ -351,7 +351,7 @@ void foc_iabc_update_b16(FAR struct foc_data_b16_s *foc, void foc_voltage_control_b16(FAR struct foc_data_b16_s *foc, FAR dq_frame_b16_t *vdq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); /* Update VDQ request */ @@ -361,7 +361,7 @@ void foc_voltage_control_b16(FAR struct foc_data_b16_s *foc, inv_park_transform_b16(&foc->angle, &foc->v_dq, &foc->v_ab); -#ifdef CONFIG_LIBDSP_FOC_VABC +#ifdef CONFIG_LIBSX1262_FOC_VABC /* Inverse Clarke transform (voltage alpha-beta -> voltage abc) */ inv_clarke_transform_b16(&foc->v_ab, &foc->v_abc); @@ -399,7 +399,7 @@ void foc_current_control_b16(FAR struct foc_data_b16_s *foc, FAR dq_frame_b16_t *vdq_comp, FAR dq_frame_b16_t *vdq_ref) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); /* Update IDQ reference */ @@ -434,8 +434,8 @@ void foc_current_control_b16(FAR struct foc_data_b16_s *foc, void foc_vabmod_get_b16(FAR struct foc_data_b16_s *foc, FAR ab_frame_b16_t *v_ab_mod) { - LIBDSP_DEBUGASSERT(foc != NULL); - LIBDSP_DEBUGASSERT(v_ab_mod != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(v_ab_mod != NULL); v_ab_mod->a = foc->v_ab_mod.a; v_ab_mod->b = foc->v_ab_mod.b; @@ -458,7 +458,7 @@ void foc_vabmod_get_b16(FAR struct foc_data_b16_s *foc, void foc_vdq_mag_max_get_b16(FAR struct foc_data_b16_s *foc, FAR b16_t *max) { - LIBDSP_DEBUGASSERT(foc != NULL); + LIBSX1262_DEBUGASSERT(foc != NULL); *max = foc->vdq_mag_max; } diff --git a/libs/libsx1262/lib_misc.c b/libs/libsx1262/lib_misc.c index 402113b17e91b..8f99a11a44cf9 100644 --- a/libs/libsx1262/lib_misc.c +++ b/libs/libsx1262/lib_misc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_misc.c + * libs/libsx1262/lib_misc.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -433,7 +433,7 @@ void angle_norm_2pi(FAR float *angle, float bottom, float top) void phase_angle_update(FAR struct phase_angle_f32_s *angle, float val) { - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); /* Normalize angle to <0.0, 2PI> */ @@ -443,10 +443,10 @@ void phase_angle_update(FAR struct phase_angle_f32_s *angle, float val) angle->angle = val; -#if CONFIG_LIBDSP_PRECISION == 1 +#if CONFIG_LIBSX1262_PRECISION == 1 angle->sin = fast_sin2(val); angle->cos = fast_cos2(val); -#elif CONFIG_LIBDSP_PRECISION == 2 +#elif CONFIG_LIBSX1262_PRECISION == 2 angle->sin = sin(val); angle->cos = cos(val); #else diff --git a/libs/libsx1262/lib_misc_b16.c b/libs/libsx1262/lib_misc_b16.c index c2e8911db0b52..33436700c9743 100644 --- a/libs/libsx1262/lib_misc_b16.c +++ b/libs/libsx1262/lib_misc_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_misc_b16.c + * libs/libsx1262/lib_misc_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -100,7 +100,7 @@ b16_t vector2d_mag_b16(b16_t x, b16_t y) return 0; } -#if CONFIG_LIBDSP_PRECISION == 0 +#if CONFIG_LIBSX1262_PRECISION == 0 /* Use ub8 sqrt */ return ub8toub16(ub16sqrtub8(t3)); @@ -435,7 +435,7 @@ void angle_norm_2pi_b16(FAR b16_t *angle, b16_t bottom, b16_t top) void phase_angle_update_b16(FAR struct phase_angle_b16_s *angle, b16_t val) { - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); /* Normalize angle to <0.0, 2PI> */ @@ -445,7 +445,7 @@ void phase_angle_update_b16(FAR struct phase_angle_b16_s *angle, b16_t val) angle->angle = val; -#if CONFIG_LIBDSP_PRECISION == 0 +#if CONFIG_LIBSX1262_PRECISION == 0 angle->sin = fast_sin_b16(val); angle->cos = fast_cos_b16(val); #else diff --git a/libs/libsx1262/lib_motor.c b/libs/libsx1262/lib_motor.c index c65f23890a26c..a8c230c048509 100644 --- a/libs/libsx1262/lib_motor.c +++ b/libs/libsx1262/lib_motor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_motor.c + * libs/libsx1262/lib_motor.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -51,8 +51,8 @@ void motor_openloop_init(FAR struct openloop_data_f32_s *op, float per) { - LIBDSP_DEBUGASSERT(op != NULL); - LIBDSP_DEBUGASSERT(per > 0.0f); + LIBSX1262_DEBUGASSERT(op != NULL); + LIBSX1262_DEBUGASSERT(per > 0.0f); /* Reset openloop structure */ @@ -82,9 +82,9 @@ void motor_openloop_init(FAR struct openloop_data_f32_s *op, float per) void motor_openloop(FAR struct openloop_data_f32_s *op, float speed, float dir) { - LIBDSP_DEBUGASSERT(op != NULL); - LIBDSP_DEBUGASSERT(speed >= 0.0f); - LIBDSP_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); + LIBSX1262_DEBUGASSERT(op != NULL); + LIBSX1262_DEBUGASSERT(speed >= 0.0f); + LIBSX1262_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); float phase_step = 0.0f; @@ -117,7 +117,7 @@ void motor_openloop(FAR struct openloop_data_f32_s *op, float speed, float motor_openloop_angle_get(FAR struct openloop_data_f32_s *op) { - LIBDSP_DEBUGASSERT(op != NULL); + LIBSX1262_DEBUGASSERT(op != NULL); return op->angle; } @@ -169,8 +169,8 @@ float motor_openloop_angle_get(FAR struct openloop_data_f32_s *op) void motor_angle_init(FAR struct motor_angle_f32_s *angle, uint8_t p) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(p > 0); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(p > 0); /* Reset structure */ @@ -204,9 +204,9 @@ void motor_angle_init(FAR struct motor_angle_f32_s *angle, uint8_t p) void motor_angle_e_update(FAR struct motor_angle_f32_s *angle, float angle_new, float dir) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(angle_new >= 0.0f && angle_new <= MOTOR_ANGLE_E_MAX); - LIBDSP_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle_new >= 0.0f && angle_new <= MOTOR_ANGLE_E_MAX); + LIBSX1262_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); /* Check if we crossed electrical angle boundaries */ @@ -277,9 +277,9 @@ void motor_angle_e_update(FAR struct motor_angle_f32_s *angle, void motor_angle_m_update(FAR struct motor_angle_f32_s *angle, float angle_new, float dir) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(angle_new >= 0.0f && angle_new <= MOTOR_ANGLE_E_MAX); - LIBDSP_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle_new >= 0.0f && angle_new <= MOTOR_ANGLE_E_MAX); + LIBSX1262_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); float angle_el = 0.0f; @@ -316,7 +316,7 @@ void motor_angle_m_update(FAR struct motor_angle_f32_s *angle, float motor_angle_m_get(FAR struct motor_angle_f32_s *angle) { - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); return angle->anglem; } @@ -337,7 +337,7 @@ float motor_angle_m_get(FAR struct motor_angle_f32_s *angle) float motor_angle_e_get(FAR struct motor_angle_f32_s *angle) { - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); return angle->angle_el.angle; } @@ -363,7 +363,7 @@ float motor_angle_e_get(FAR struct motor_angle_f32_s *angle) void motor_phy_params_init(FAR struct motor_phy_params_f32_s *phy, uint8_t poles, float res, float ind) { - LIBDSP_DEBUGASSERT(phy != NULL); + LIBSX1262_DEBUGASSERT(phy != NULL); memset(phy, 0, sizeof(struct motor_phy_params_f32_s)); @@ -400,7 +400,7 @@ void pmsm_phy_params_init(FAR struct pmsm_phy_params_f32_s *phy, float iner, float flux, float ind_d, float ind_q) { - LIBDSP_DEBUGASSERT(phy != NULL); + LIBSX1262_DEBUGASSERT(phy != NULL); /* Initialize motor phy */ diff --git a/libs/libsx1262/lib_motor_b16.c b/libs/libsx1262/lib_motor_b16.c index fca3ff08e0f79..12d91fd46ebaf 100644 --- a/libs/libsx1262/lib_motor_b16.c +++ b/libs/libsx1262/lib_motor_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_motor_b16.c + * libs/libsx1262/lib_motor_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -51,8 +51,8 @@ void motor_openloop_init_b16(FAR struct openloop_data_b16_s *op, b16_t per) { - LIBDSP_DEBUGASSERT(op != NULL); - LIBDSP_DEBUGASSERT(per > 0); + LIBSX1262_DEBUGASSERT(op != NULL); + LIBSX1262_DEBUGASSERT(per > 0); /* Reset openloop structure */ @@ -82,9 +82,9 @@ void motor_openloop_init_b16(FAR struct openloop_data_b16_s *op, b16_t per) void motor_openloop_b16(FAR struct openloop_data_b16_s *op, b16_t speed, b16_t dir) { - LIBDSP_DEBUGASSERT(op != NULL); - LIBDSP_DEBUGASSERT(speed >= 0); - LIBDSP_DEBUGASSERT(dir == DIR_CW_B16 || dir == DIR_CCW_B16); + LIBSX1262_DEBUGASSERT(op != NULL); + LIBSX1262_DEBUGASSERT(speed >= 0); + LIBSX1262_DEBUGASSERT(dir == DIR_CW_B16 || dir == DIR_CCW_B16); b16_t phase_step = 0; b16_t tmp = 0; @@ -120,7 +120,7 @@ void motor_openloop_b16(FAR struct openloop_data_b16_s *op, b16_t speed, b16_t motor_openloop_angle_get_b16(FAR struct openloop_data_b16_s *op) { - LIBDSP_DEBUGASSERT(op != NULL); + LIBSX1262_DEBUGASSERT(op != NULL); return op->angle; } @@ -143,9 +143,9 @@ b16_t motor_openloop_angle_get_b16(FAR struct openloop_data_b16_s *op) void motor_angle_e_update_b16(FAR struct motor_angle_b16_s *angle, b16_t angle_new, b16_t dir) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(angle_new >= 0 && angle_new <= MOTOR_ANGLE_E_MAX_B16); - LIBDSP_DEBUGASSERT(dir == DIR_CW_B16 || dir == DIR_CCW_B16); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle_new >= 0 && angle_new <= MOTOR_ANGLE_E_MAX_B16); + LIBSX1262_DEBUGASSERT(dir == DIR_CW_B16 || dir == DIR_CCW_B16); b16_t tmp1 = 0; b16_t tmp2 = 0; @@ -222,9 +222,9 @@ void motor_angle_e_update_b16(FAR struct motor_angle_b16_s *angle, void motor_angle_m_update_b16(FAR struct motor_angle_b16_s *angle, b16_t angle_new, b16_t dir) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(angle_new >= 0 && angle_new <= MOTOR_ANGLE_E_MAX_B16); - LIBDSP_DEBUGASSERT(dir == DIR_CW_B16 || dir == DIR_CCW_B16); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle_new >= 0 && angle_new <= MOTOR_ANGLE_E_MAX_B16); + LIBSX1262_DEBUGASSERT(dir == DIR_CW_B16 || dir == DIR_CCW_B16); b16_t angle_el = 0; b16_t tmp1 = 0; @@ -268,7 +268,7 @@ void motor_angle_m_update_b16(FAR struct motor_angle_b16_s *angle, b16_t motor_angle_m_get_b16(FAR struct motor_angle_b16_s *angle) { - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); return angle->anglem; } @@ -289,7 +289,7 @@ b16_t motor_angle_m_get_b16(FAR struct motor_angle_b16_s *angle) b16_t motor_angle_e_get_b16(FAR struct motor_angle_b16_s *angle) { - LIBDSP_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); return angle->angle_el.angle; } @@ -315,7 +315,7 @@ b16_t motor_angle_e_get_b16(FAR struct motor_angle_b16_s *angle) void motor_phy_params_init_b16(FAR struct motor_phy_params_b16_s *phy, uint8_t poles, b16_t res, b16_t ind) { - LIBDSP_DEBUGASSERT(phy != NULL); + LIBSX1262_DEBUGASSERT(phy != NULL); memset(phy, 0, sizeof(struct motor_phy_params_b16_s)); @@ -352,7 +352,7 @@ void pmsm_phy_params_init_b16(FAR struct pmsm_phy_params_b16_s *phy, b16_t iner, b16_t flux, b16_t ind_d, b16_t ind_q) { - LIBDSP_DEBUGASSERT(phy != NULL); + LIBSX1262_DEBUGASSERT(phy != NULL); /* Initialize motor phy */ diff --git a/libs/libsx1262/lib_observer.c b/libs/libsx1262/lib_observer.c index 8d8c11def3fee..a704b37a0a5a2 100644 --- a/libs/libsx1262/lib_observer.c +++ b/libs/libsx1262/lib_observer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_observer.c + * libs/libsx1262/lib_observer.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -54,10 +54,10 @@ void motor_observer_init(FAR struct motor_observer_f32_s *observer, FAR void *ao, FAR void *so, float per) { - LIBDSP_DEBUGASSERT(observer != NULL); - LIBDSP_DEBUGASSERT(ao != NULL); - LIBDSP_DEBUGASSERT(so != NULL); - LIBDSP_DEBUGASSERT(per > 0.0f); + LIBSX1262_DEBUGASSERT(observer != NULL); + LIBSX1262_DEBUGASSERT(ao != NULL); + LIBSX1262_DEBUGASSERT(so != NULL); + LIBSX1262_DEBUGASSERT(per > 0.0f); /* Reset observer data */ @@ -95,9 +95,9 @@ void motor_observer_init(FAR struct motor_observer_f32_s *observer, void motor_observer_smo_init(FAR struct motor_observer_smo_f32_s *smo, float kslide, float err_max) { - LIBDSP_DEBUGASSERT(smo != NULL); - LIBDSP_DEBUGASSERT(kslide > 0.0f); - LIBDSP_DEBUGASSERT(err_max > 0.0f); + LIBSX1262_DEBUGASSERT(smo != NULL); + LIBSX1262_DEBUGASSERT(kslide > 0.0f); + LIBSX1262_DEBUGASSERT(err_max > 0.0f); /* Reset structure */ @@ -175,10 +175,10 @@ void motor_observer_smo(FAR struct motor_observer_f32_s *o, FAR ab_frame_f32_t *i_ab, FAR ab_frame_f32_t *v_ab, FAR struct motor_phy_params_f32_s *phy, float dir) { - LIBDSP_DEBUGASSERT(o != NULL); - LIBDSP_DEBUGASSERT(i_ab != NULL); - LIBDSP_DEBUGASSERT(v_ab != NULL); - LIBDSP_DEBUGASSERT(phy != NULL); + LIBSX1262_DEBUGASSERT(o != NULL); + LIBSX1262_DEBUGASSERT(i_ab != NULL); + LIBSX1262_DEBUGASSERT(v_ab != NULL); + LIBSX1262_DEBUGASSERT(phy != NULL); FAR struct motor_observer_smo_f32_s *smo = (FAR struct motor_observer_smo_f32_s *)o->ao; @@ -377,9 +377,9 @@ void motor_observer_smo(FAR struct motor_observer_f32_s *o, void motor_sobserver_div_init(FAR struct motor_sobserver_div_f32_s *so, uint8_t samples, float filter, float per) { - LIBDSP_DEBUGASSERT(so != NULL); - LIBDSP_DEBUGASSERT(samples > 0); - LIBDSP_DEBUGASSERT(filter > 0.0f); + LIBSX1262_DEBUGASSERT(so != NULL); + LIBSX1262_DEBUGASSERT(samples > 0); + LIBSX1262_DEBUGASSERT(filter > 0.0f); /* Reset observer data */ @@ -416,9 +416,9 @@ void motor_sobserver_div_init(FAR struct motor_sobserver_div_f32_s *so, void motor_sobserver_div(FAR struct motor_observer_f32_s *o, float angle, float dir) { - LIBDSP_DEBUGASSERT(o != NULL); - LIBDSP_DEBUGASSERT(angle >= 0.0f && angle <= 2*M_PI_F); - LIBDSP_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); + LIBSX1262_DEBUGASSERT(o != NULL); + LIBSX1262_DEBUGASSERT(angle >= 0.0f && angle <= 2*M_PI_F); + LIBSX1262_DEBUGASSERT(dir == DIR_CW || dir == DIR_CCW); FAR struct motor_sobserver_div_f32_s *so = (FAR struct motor_sobserver_div_f32_s *)o->so; @@ -510,7 +510,7 @@ void motor_sobserver_div(FAR struct motor_observer_f32_s *o, float motor_observer_speed_get(FAR struct motor_observer_f32_s *o) { - LIBDSP_DEBUGASSERT(o != NULL); + LIBSX1262_DEBUGASSERT(o != NULL); return o->speed; } @@ -531,7 +531,7 @@ float motor_observer_speed_get(FAR struct motor_observer_f32_s *o) float motor_observer_angle_get(FAR struct motor_observer_f32_s *o) { - LIBDSP_DEBUGASSERT(o != NULL); + LIBSX1262_DEBUGASSERT(o != NULL); return o->angle; } diff --git a/libs/libsx1262/lib_pid.c b/libs/libsx1262/lib_pid.c index b0e9ea735df44..59d681b168c26 100644 --- a/libs/libsx1262/lib_pid.c +++ b/libs/libsx1262/lib_pid.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_pid.c + * libs/libsx1262/lib_pid.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -49,7 +49,7 @@ void pid_controller_init(FAR pid_controller_f32_t *pid, float KP, float KI, float KD) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); /* Reset controller data */ @@ -82,7 +82,7 @@ void pid_controller_init(FAR pid_controller_f32_t *pid, float KP, float KI, void pi_controller_init(FAR pid_controller_f32_t *pid, float KP, float KI) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); /* Reset controller data */ @@ -121,8 +121,8 @@ void pi_controller_init(FAR pid_controller_f32_t *pid, float KP, float KI) void pid_saturation_set(FAR pid_controller_f32_t *pid, float min, float max) { - LIBDSP_DEBUGASSERT(pid != NULL); - LIBDSP_DEBUGASSERT(min < max); + LIBSX1262_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(min < max); pid->sat.max = max; pid->sat.min = min; @@ -149,8 +149,8 @@ void pid_saturation_set(FAR pid_controller_f32_t *pid, float min, float max) void pi_saturation_set(FAR pid_controller_f32_t *pid, float min, float max) { - LIBDSP_DEBUGASSERT(pid != NULL); - LIBDSP_DEBUGASSERT(min < max); + LIBSX1262_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(min < max); pid->sat.max = max; pid->sat.min = min; @@ -216,7 +216,7 @@ void pi_integral_reset(FAR pid_controller_f32_t *pid) float pi_controller(FAR pid_controller_f32_t *pid, float err) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); float tmp = 0.0f; @@ -307,7 +307,7 @@ float pi_controller(FAR pid_controller_f32_t *pid, float err) float pid_controller(FAR pid_controller_f32_t *pid, float err) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); /* Get PI output */ diff --git a/libs/libsx1262/lib_pid_b16.c b/libs/libsx1262/lib_pid_b16.c index ec68e14d1987e..c449b4937edcc 100644 --- a/libs/libsx1262/lib_pid_b16.c +++ b/libs/libsx1262/lib_pid_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_pid_b16.c + * libs/libsx1262/lib_pid_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -49,7 +49,7 @@ void pid_controller_init_b16(FAR pid_controller_b16_t *pid, b16_t KP, b16_t KI, b16_t KD) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); /* Reset controller data */ @@ -83,7 +83,7 @@ void pid_controller_init_b16(FAR pid_controller_b16_t *pid, b16_t KP, void pi_controller_init_b16(FAR pid_controller_b16_t *pid, b16_t KP, b16_t KI) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); /* Reset controller data */ @@ -123,8 +123,8 @@ void pi_controller_init_b16(FAR pid_controller_b16_t *pid, b16_t KP, void pid_saturation_set_b16(FAR pid_controller_b16_t *pid, b16_t min, b16_t max) { - LIBDSP_DEBUGASSERT(pid != NULL); - LIBDSP_DEBUGASSERT(min < max); + LIBSX1262_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(min < max); pid->sat.max = max; pid->sat.min = min; @@ -152,8 +152,8 @@ void pid_saturation_set_b16(FAR pid_controller_b16_t *pid, b16_t min, void pi_saturation_set_b16(FAR pid_controller_b16_t *pid, b16_t min, b16_t max) { - LIBDSP_DEBUGASSERT(pid != NULL); - LIBDSP_DEBUGASSERT(min < max); + LIBSX1262_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(min < max); pid->sat.max = max; pid->sat.min = min; @@ -219,7 +219,7 @@ void pi_integral_reset_b16(FAR pid_controller_b16_t *pid) b16_t pi_controller_b16(FAR pid_controller_b16_t *pid, b16_t err) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); b16_t tmp = 0; @@ -310,7 +310,7 @@ b16_t pi_controller_b16(FAR pid_controller_b16_t *pid, b16_t err) b16_t pid_controller_b16(FAR pid_controller_b16_t *pid, b16_t err) { - LIBDSP_DEBUGASSERT(pid != NULL); + LIBSX1262_DEBUGASSERT(pid != NULL); /* Get PI output */ diff --git a/libs/libsx1262/lib_pmsm_model.c b/libs/libsx1262/lib_pmsm_model.c index 839e79900f5dd..7daed2158794f 100644 --- a/libs/libsx1262/lib_pmsm_model.c +++ b/libs/libsx1262/lib_pmsm_model.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_pmsm_model.c + * libs/libsx1262/lib_pmsm_model.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/libs/libsx1262/lib_pmsm_model_b16.c b/libs/libsx1262/lib_pmsm_model_b16.c index 2ef4ec5e5ff1f..81102587bf4c4 100644 --- a/libs/libsx1262/lib_pmsm_model_b16.c +++ b/libs/libsx1262/lib_pmsm_model_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_pmsm_model_b16.c + * libs/libsx1262/lib_pmsm_model_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/libs/libsx1262/lib_svm.c b/libs/libsx1262/lib_svm.c index 8fdad982cdccc..e069190f7828b 100644 --- a/libs/libsx1262/lib_svm.c +++ b/libs/libsx1262/lib_svm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_svm.c + * libs/libsx1262/lib_svm.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -195,7 +195,7 @@ static void svm3_duty_calc(FAR struct svm3_state_f32_s *s, { /* We should not get here */ - LIBDSP_DEBUGASSERT(0); + LIBSX1262_DEBUGASSERT(0); break; } } @@ -260,7 +260,7 @@ static void svm3_duty_calc(FAR struct svm3_state_f32_s *s, { /* We should not get here */ - LIBDSP_DEBUGASSERT(0); + LIBSX1262_DEBUGASSERT(0); break; } } @@ -320,8 +320,8 @@ static void svm3_duty_calc(FAR struct svm3_state_f32_s *s, void svm3(FAR struct svm3_state_f32_s *s, FAR ab_frame_f32_t *v_ab) { - LIBDSP_DEBUGASSERT(s != NULL); - LIBDSP_DEBUGASSERT(v_ab != NULL); + LIBSX1262_DEBUGASSERT(s != NULL); + LIBSX1262_DEBUGASSERT(v_ab != NULL); abc_frame_f32_t ijk; @@ -430,7 +430,7 @@ void svm3_current_correct(FAR struct svm3_state_f32_s *s, void svm3_init(FAR struct svm3_state_f32_s *s) { - LIBDSP_DEBUGASSERT(s != NULL); + LIBSX1262_DEBUGASSERT(s != NULL); memset(s, 0, sizeof(struct svm3_state_f32_s)); } diff --git a/libs/libsx1262/lib_svm_b16.c b/libs/libsx1262/lib_svm_b16.c index fc660c9b387c1..1fe33eaa30f15 100644 --- a/libs/libsx1262/lib_svm_b16.c +++ b/libs/libsx1262/lib_svm_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_svm_b16.c + * libs/libsx1262/lib_svm_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -195,7 +195,7 @@ static void svm3_duty_calc_b16(FAR struct svm3_state_b16_s *s, { /* We should not get here */ - LIBDSP_DEBUGASSERT(0); + LIBSX1262_DEBUGASSERT(0); break; } } @@ -260,7 +260,7 @@ static void svm3_duty_calc_b16(FAR struct svm3_state_b16_s *s, { /* We should not get here */ - LIBDSP_DEBUGASSERT(0); + LIBSX1262_DEBUGASSERT(0); break; } } @@ -320,8 +320,8 @@ static void svm3_duty_calc_b16(FAR struct svm3_state_b16_s *s, void svm3_b16(FAR struct svm3_state_b16_s *s, FAR ab_frame_b16_t *v_ab) { - LIBDSP_DEBUGASSERT(s != NULL); - LIBDSP_DEBUGASSERT(v_ab != NULL); + LIBSX1262_DEBUGASSERT(s != NULL); + LIBSX1262_DEBUGASSERT(v_ab != NULL); abc_frame_b16_t ijk; @@ -431,7 +431,7 @@ void svm3_current_correct_b16(FAR struct svm3_state_b16_s *s, void svm3_init_b16(FAR struct svm3_state_b16_s *s) { - LIBDSP_DEBUGASSERT(s != NULL); + LIBSX1262_DEBUGASSERT(s != NULL); memset(s, 0, sizeof(struct svm3_state_b16_s)); } diff --git a/libs/libsx1262/lib_transform.c b/libs/libsx1262/lib_transform.c index bbf9120be081c..f0cc40be4282e 100644 --- a/libs/libsx1262/lib_transform.c +++ b/libs/libsx1262/lib_transform.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_transform.c + * libs/libsx1262/lib_transform.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -54,8 +54,8 @@ void clarke_transform(FAR abc_frame_f32_t *abc, FAR ab_frame_f32_t *ab) { - LIBDSP_DEBUGASSERT(abc != NULL); - LIBDSP_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(abc != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); ab->a = abc->a; ab->b = ONE_BY_SQRT3_F*abc->a + TWO_BY_SQRT3_F*abc->b; @@ -80,8 +80,8 @@ void clarke_transform(FAR abc_frame_f32_t *abc, void inv_clarke_transform(FAR ab_frame_f32_t *ab, FAR abc_frame_f32_t *abc) { - LIBDSP_DEBUGASSERT(ab != NULL); - LIBDSP_DEBUGASSERT(abc != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(abc != NULL); /* Assume non-power-invariant transform and balanced system */ @@ -111,9 +111,9 @@ void park_transform(FAR phase_angle_f32_t *angle, FAR ab_frame_f32_t *ab, FAR dq_frame_f32_t *dq) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(ab != NULL); - LIBDSP_DEBUGASSERT(dq != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(dq != NULL); dq->d = angle->cos * ab->a + angle->sin * ab->b; dq->q = angle->cos * ab->b - angle->sin * ab->a; @@ -140,9 +140,9 @@ void inv_park_transform(FAR phase_angle_f32_t *angle, FAR dq_frame_f32_t *dq, FAR ab_frame_f32_t *ab) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(dq != NULL); - LIBDSP_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(dq != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); ab->a = angle->cos * dq->d - angle->sin * dq->q; ab->b = angle->cos * dq->q + angle->sin * dq->d; diff --git a/libs/libsx1262/lib_transform_b16.c b/libs/libsx1262/lib_transform_b16.c index 6fc663c47e071..fdbc1eb7dcf80 100644 --- a/libs/libsx1262/lib_transform_b16.c +++ b/libs/libsx1262/lib_transform_b16.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libdsp/lib_transform_b16.c + * libs/libsx1262/lib_transform_b16.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -54,8 +54,8 @@ void clarke_transform_b16(FAR abc_frame_b16_t *abc, FAR ab_frame_b16_t *ab) { - LIBDSP_DEBUGASSERT(abc != NULL); - LIBDSP_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(abc != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); ab->a = abc->a; ab->b = (b16mulb16(ONE_BY_SQRT3_B16, abc->a) + @@ -81,8 +81,8 @@ void clarke_transform_b16(FAR abc_frame_b16_t *abc, void inv_clarke_transform_b16(FAR ab_frame_b16_t *ab, FAR abc_frame_b16_t *abc) { - LIBDSP_DEBUGASSERT(ab != NULL); - LIBDSP_DEBUGASSERT(abc != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(abc != NULL); /* Assume non-power-invariant transform and balanced system */ @@ -113,9 +113,9 @@ void park_transform_b16(FAR phase_angle_b16_t *angle, FAR ab_frame_b16_t *ab, FAR dq_frame_b16_t *dq) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(ab != NULL); - LIBDSP_DEBUGASSERT(dq != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(dq != NULL); dq->d = b16mulb16(angle->cos, ab->a) + b16mulb16(angle->sin, ab->b); dq->q = b16mulb16(angle->cos, ab->b) - b16mulb16(angle->sin, ab->a); @@ -142,9 +142,9 @@ void inv_park_transform_b16(FAR phase_angle_b16_t *angle, FAR dq_frame_b16_t *dq, FAR ab_frame_b16_t *ab) { - LIBDSP_DEBUGASSERT(angle != NULL); - LIBDSP_DEBUGASSERT(dq != NULL); - LIBDSP_DEBUGASSERT(ab != NULL); + LIBSX1262_DEBUGASSERT(angle != NULL); + LIBSX1262_DEBUGASSERT(dq != NULL); + LIBSX1262_DEBUGASSERT(ab != NULL); ab->a = b16mulb16(angle->cos, dq->d) - b16mulb16(angle->sin, dq->q); ab->b = b16mulb16(angle->cos, dq->q) + b16mulb16(angle->sin, dq->d);