Skip to content

Commit f2256ff

Browse files
committed
fixup review comments
1 parent 2ab0333 commit f2256ff

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

src/rp2_common/hardware_dma/include/hardware/dma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ static inline void dma_channel_start(uint channel) {
535535
*\endcode
536536
*
537537
* \if rp2350_specific
538-
* RP2350 only: Due to errata RP12350-E5 (see the RP2350 datasheet for further detail), it is necessary to clear the enable bit of
538+
* RP2350 only: Due to errata RP2350-E5 (see the RP2350 datasheet for further detail), it is necessary to clear the enable bit of
539539
* the aborted channel and any chained channels prior to the abort to prevent re-triggering.
540540
* \endif
541541
*

src/rp2_common/hardware_pio/include/hardware/pio.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ static_assert(DREQ_PIO0_TX2 == DREQ_PIO0_TX0 + 2, "");
215215
static_assert(DREQ_PIO0_TX3 == DREQ_PIO0_TX0 + 3, "");
216216
static_assert(DREQ_PIO0_RX0 == DREQ_PIO0_TX0 + NUM_PIO_STATE_MACHINES, "");
217217
static_assert(DREQ_PIO1_RX0 == DREQ_PIO1_TX0 + NUM_PIO_STATE_MACHINES, "");
218+
#if NUM_PIOS > 2
219+
static_assert(DREQ_PIO2_TX0 == DREQ_PIO1_RX0 + NUM_PIO_STATE_MACHINES, "");
220+
static_assert(DREQ_PIO2_RX0 == DREQ_PIO2_TX0 + NUM_PIO_STATE_MACHINES, "");
221+
#endif
218222
#define PIO_DREQ_NUM(pio, sm, is_tx) ((sm) + (((is_tx) ? 0 : NUM_PIO_STATE_MACHINES) + PIO_NUM(pio) * (DREQ_PIO1_TX0 - DREQ_PIO0_TX0)))
219223
#endif
220224

src/rp2_common/pico_double/include/pico/double.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern "C" {
2121
* \brief Optimized double-precision floating point functions
2222
*
2323
* An application can take control of the floating point routines used in the application over and above what is provided by the compiler,
24-
* by depending on the pico_double library. A user might want to do this
24+
* by depending on the pico_double library. A user might want to do this:
2525
*
2626
* 1. To use optimized software implementations provided by the RP2-series device's bootrom or the SDK
2727
* 2. To use optimized combined software/hardware implementations utilizing custom RP2-series hardware for acceleration
@@ -52,14 +52,14 @@ extern "C" {
5252
* floating point implementation; they are however usually fine for the majority of cases
5353
* \endif
5454
*
55-
* On Arm, (replacement) optimized implementations are provided for the following compiler built-ins when
56-
* and math library functions when using `pico_dobule_pico`:
55+
* On Arm, (replacement) optimized implementations are provided for the following compiler built-ins
56+
* and math library functions when using `pico_double_pico`:
5757
*
5858
* - basic arithmetic:
5959
*
6060
* __aeabi_dadd, __aeabi_ddiv, __aeabi_dmul, __aeabi_drsub, __aeabi_dsub
6161
*
62-
* - comparison: (except `pico_double_pico_vfp`)
62+
* - comparison:
6363
*
6464
* __aeabi_cfcmpeq, __aeabi_cfrcmple, __aeabi_cfcmple, __aeabi_dcmpeq, __aeabi_dcmplt, __aeabi_dcmple, __aeabi_dcmpge, __aeabi_dcmpgt, __aeabi_dcmpun
6565
*
@@ -113,24 +113,24 @@ extern "C" {
113113
*
114114
* fix2double, ufix2double, fix642double, ufix642double
115115
*
116-
* note: on `pico_double_vfp` the 32-bit functions are curretly _only_ provided as C macros and must use a compile
116+
* note: on `pico_double_vfp` the 32-bit functions are currently _only_ provided as C macros and must use a compile
117117
* time constant between 1 and 32 for the fixed point position
118118
*
119119
* - double -> (u)fix (round towards zero):
120120
*
121121
* double2fix_z, double2ufix_z, double2fix64_z, double2ufix64_z
122122
*
123-
* note: on `pico_double_vfp` the 32-bit functions are curretly _only_ provided as C macros and must use a compile
123+
* note: on `pico_double_vfp` the 32-bit functions are currently _only_ provided as C macros and must use a compile
124124
* time constant between 1 and 32 for the fixed point position
125125
*
126126
* - double -> (u)fix (round towards -infinity):
127127
*
128128
* double2fix, double2ufix, double2fix64, double2ufix64
129129
*
130-
* note: on `pico_double_vfp` the 32-bit functions are curretly _only_ provided as C macros and must use a compile
130+
* note: on `pico_double_vfp` the 32-bit functions are currently _only_ provided as C macros and must use a compile
131131
* time constant between 1 and 32 for the fixed point position
132132
*
133-
* - Even faster methods versions of divide and square-root that do not round correctly:
133+
* - Even faster versions of divide and square-root functions that do not round correctly:
134134
*
135135
* ddiv_fast, sqrt_fast (these do not round correctly)
136136
*
@@ -185,7 +185,7 @@ double powint(double x, int y);
185185
double ddiv_fast(double n, double d);
186186
double sqrt_fast(double f);
187187
double fma_fast(double x, double y, double z); // this is not fused
188-
double mla(double x, double y, double z); // another name for fma_flast
188+
double mla(double x, double y, double z); // another name for fma_fast
189189
#endif
190190

191191
#endif

src/rp2_common/pico_float/include/pico/float.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ extern "C" {
5151
*
5252
* 1. `pico_float_pico_vfp` - this library leaves basic C single-precision floating point operations to the compiler
5353
* which can use inlined VFP (Arm FPU) code. Custom optimized versions of trigonometric and scientific functions are provided.
54-
* no DCP (RP2350 Double co-processor) instructions are used.
54+
* No DCP (RP2350 Double co-processor) instructions are used.
5555
* 2. `pico_float_pico_dcp` - this library prevents the compiler injecting inlined VFP code, and also implements
56-
* all single-precision floating point operations in optimized DCP or M33 code. This option is not as fast
57-
* as pico_float_pico_vfp, however allows floating point operations without enabling the floating point co-processor
56+
* all single-precision floating point operations in optimized DCP or M33 code. This option is not quite as fast
57+
* as pico_float_pico_vfp, however it allows floating point operations without enabling the floating point co-processor
5858
* on the CPU; this can be beneficial in certain circumstances, e.g. where leaving stack in tasks or interrupts
5959
* for the floating point state is undesirable.
6060
*
61-
* Note: `pico_float_pico` is equivalent ot `pico_flot_pico_vfp` on RP2350, as this is the most sensible default
61+
* Note: `pico_float_pico` is equivalent to `pico_float_pico_vfp` on RP2350, as this is the most sensible default
6262
* \endif
6363
*
64-
* On Arm, (replacement) optimized implementations are provided for the following compiler built-ins when
64+
* On Arm, (replacement) optimized implementations are provided for the following compiler built-ins
6565
* and math library functions when using `_pico` variants of `pico_float`:
6666
*
6767
* - basic arithmetic: (except `pico_float_pico_vfp`)
@@ -104,13 +104,13 @@ extern "C" {
104104
*
105105
* int2float, uint2float, int642float, uint642float
106106
*
107-
* note: on `pico_float_vfp` the 32-bit functions are also provided as C macros since they map to inline VFP code
107+
* note: on `pico_float_pico_vfp` the 32-bit functions are also provided as C macros since they map to inline VFP code
108108
*
109109
* - (u)float -> int (round towards zero):
110110
*
111111
* float2int_z, float2uint_z, float2int64_z, float2uint64_z
112112
*
113-
* note: on `pico_float_vfp` the 32-bit functions are also provided as C macros since they map to inline VFP code
113+
* note: on `pico_float_pico_vfp` the 32-bit functions are also provided as C macros since they map to inline VFP code
114114
*
115115
* - (u)float -> int (round towards -infinity):
116116
*
@@ -126,17 +126,17 @@ extern "C" {
126126
*
127127
* float2fix_z, float2ufix_z, float2fix64_z, float2ufix64_z
128128
*
129-
* note: on `pico_float_vfp` the 32-bit functions are also provided as C macros since they can map to inline VFP code
129+
* note: on `pico_float_pico_vfp` the 32-bit functions are also provided as C macros since they can map to inline VFP code
130130
* when the number of fractional bits is a compile time constant between 1 and 32
131131
*
132132
* - float -> (u)fix (round towards -infinity):
133133
*
134134
* float2fix, float2ufix, float2fix64, float2ufix64
135135
*
136-
* note: on `pico_float_vfp` the 32-bit functions are also provided as C macros since they can map to inline VFP code
136+
* note: on `pico_float_pico_vfp` the 32-bit functions are also provided as C macros since they can map to inline VFP code
137137
* when the number of fractional bits is a compile time constant between 1 and 32
138138
*
139-
* - Even faster methods versions of divide and square-root that do not round correctly: (`pico_float_pico_dcp` only)
139+
* - Even faster versions of divide and square-root functions that do not round correctly: (`pico_float_pico_dcp` only)
140140
*
141141
* fdiv_fast, sqrtf_fast
142142
*
@@ -276,12 +276,12 @@ uint64_t float2ufix64(float f, int e);
276276
#define _float2ufix_inline(f, e) _float2ufix_z_inline((f), (e))
277277
#endif
278278

279-
#if LIB_PIC_FLOAT_PICO_VFP
279+
#if LIB_PICO_FLOAT_PICO_VFP
280280
// may as well provide inline macros for VFP
281-
#define int2float(int32_t i) ((float)(i))
282-
#define uint2float(uint32_t i) ((float)(i))
283-
#define float2int_z(float f) ((int32_t)(f))
284-
#define float2uint_z(float f) ((uint32_t)(f))
281+
#define int2float(i) ((float)(int32_t)(i))
282+
#define uint2float(i) ((float)(uint32_t)(i))
283+
#define float2int_z(f) ((int32_t)(f))
284+
#define float2uint_z(f) ((uint32_t)(f))
285285
#endif
286286

287287
#endif

test/pico_float_test/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ endif()
8484

8585
set(FLOAT_TYPES compiler)
8686
set(DOUBLE_TYPES compiler)
87-
#if (PICO_RP2040)
88-
list(APPEND FLOAT_TYPES pico)
89-
list(APPEND DOUBLE_TYPES pico)
90-
#endif()
87+
list(APPEND FLOAT_TYPES pico)
88+
list(APPEND DOUBLE_TYPES pico)
9189
if (PICO_RP2350)
9290
if (NOT PICO_RISCV)
9391
list(APPEND FLOAT_TYPES pico_vfp pico_dcp)

0 commit comments

Comments
 (0)