CMSIS DSP Lib

Fork of mbed-dsp by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Mon Jun 23 09:30:09 2014 +0100
Parent:
3:7a284390b0ce
Commit message:
Synchronized with git revision 6e7c7bcec41226f536474daae3c13d49e4c0e865

Full URL: https://github.com/mbedmicro/mbed/commit/6e7c7bcec41226f536474daae3c13d49e4c0e865/

Fix signed unsigned compare in dsp library

Changed in this revision

cmsis_dsp/SupportFunctions/math_helper.c Show annotated file Show diff for this revision Revisions of this file
dsp/Sine_f32.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 7a284390b0ce -r 9cee975aadce cmsis_dsp/SupportFunctions/math_helper.c
--- a/cmsis_dsp/SupportFunctions/math_helper.c	Fri Nov 08 13:45:10 2013 +0000
+++ b/cmsis_dsp/SupportFunctions/math_helper.c	Mon Jun 23 09:30:09 2014 +0100
@@ -164,7 +164,8 @@
 uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples)
 {
   uint32_t i; 
-  int32_t diff, diffCrnt = 0;
+  int32_t diff;
+  uint32_t diffCrnt = 0;
   uint32_t maxDiff = 0;
 
   for (i = 0; i < numSamples; i++)
@@ -192,7 +193,8 @@
 uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t * pOut, uint32_t numSamples)
 {
   uint32_t i; 
-  int32_t diff, diffCrnt = 0;
+  int32_t diff;
+  uint32_t diffCrnt = 0;
   uint32_t maxDiff = 0;
 
   for (i = 0; i < numSamples; i++)
diff -r 7a284390b0ce -r 9cee975aadce dsp/Sine_f32.cpp
--- a/dsp/Sine_f32.cpp	Fri Nov 08 13:45:10 2013 +0000
+++ b/dsp/Sine_f32.cpp	Mon Jun 23 09:30:09 2014 +0100
@@ -34,7 +34,7 @@
 }
 
 void Sine_f32::process(float32_t *sgn_in, float32_t *sgn_out) {
-    for (int i=0; i<_block_size; i++) {
+    for (uint32_t i=0; i<_block_size; i++) {
         *sgn_out = *sgn_in + (_amplitude * arm_sin_f32(_x));
         sgn_in++; sgn_out++;
         _x += _dx;
@@ -42,7 +42,7 @@
 }
 
 void Sine_f32::generate(float32_t *sgn) {
-    for (int i=0; i<_block_size; i++) {
+    for (uint32_t i=0; i<_block_size; i++) {
         *sgn = (_amplitude * arm_sin_f32(_x));
         sgn++;
         _x += _dx;