summaryrefslogtreecommitdiff
path: root/n/avr/modules/math/fixed/test
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/modules/math/fixed/test')
-rw-r--r--n/avr/modules/math/fixed/test/Makefile2
-rw-r--r--n/avr/modules/math/fixed/test/test_fixed.c19
2 files changed, 20 insertions, 1 deletions
diff --git a/n/avr/modules/math/fixed/test/Makefile b/n/avr/modules/math/fixed/test/Makefile
index 23be911..38517e5 100644
--- a/n/avr/modules/math/fixed/test/Makefile
+++ b/n/avr/modules/math/fixed/test/Makefile
@@ -6,7 +6,7 @@ EXTRACTDOC =
MODULES = uart proto utils math/fixed math/random
CONFIGFILE = avrconfig.h
# atmega8, atmega8535, atmega128...
-AVR_MCU = atmega8
+AVR_MCU = atmega128
# -O2 : speed
# -Os : size
OPTIMIZE = -O2
diff --git a/n/avr/modules/math/fixed/test/test_fixed.c b/n/avr/modules/math/fixed/test/test_fixed.c
index 9f04880..35ea573 100644
--- a/n/avr/modules/math/fixed/test/test_fixed.c
+++ b/n/avr/modules/math/fixed/test/test_fixed.c
@@ -115,6 +115,25 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
proto_send2d ('r', rl[0], rl[1]);
}
break;
+ case c ('s', 0):
+ for (ap = 0; ap < patn; ap++)
+ for (as = 0; as < 32; as++)
+ {
+ al = patl[ap] >> as;
+ proto_send1d ('a', al);
+ rl[0] = fixed_sqrt_uf248 (al);
+ rl[1] = fixed_sqrt_ui32 (al);
+ proto_send2d ('r', rl[0], rl[1]);
+ }
+ for (i = 0; i < 64000; i++)
+ {
+ al = random_u32 ();
+ proto_send1d ('a', al);
+ rl[0] = fixed_sqrt_uf248 (al);
+ rl[1] = fixed_sqrt_ui32 (al);
+ proto_send2d ('r', rl[0], rl[1]);
+ }
+ break;
default:
proto_send0 ('?');
return;