aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2021-09-27 22:56:46 -0600
committerJosh Rahm <joshuarahm@gmail.com>2021-09-27 22:56:46 -0600
commit90eb3a0b79bfef67c70dc545b49c48928eea05f4 (patch)
tree66718a17063ce4fa5c32c4a8ac094d09f7fab6de /tests
parent5f1763ec87503527583cb1a7c6deb73604db0dfc (diff)
downloadstm32l4-90eb3a0b79bfef67c70dc545b49c48928eea05f4.tar.gz
stm32l4-90eb3a0b79bfef67c70dc545b49c48928eea05f4.tar.bz2
stm32l4-90eb3a0b79bfef67c70dc545b49c48928eea05f4.zip
Completed ws2812b 2020 Christmas Lights.ir_leds
Diffstat (limited to 'tests')
-rw-r--r--tests/test_mpu.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_mpu.c b/tests/test_mpu.c
new file mode 100644
index 0000000..551e079
--- /dev/null
+++ b/tests/test_mpu.c
@@ -0,0 +1,27 @@
+#include "test_harness.c"
+
+#include "arch/arm/cortex-m4/mpu.h"
+#include "kern/mpu/mpu_manager.h"
+
+TEST(mpu, smell)
+{
+ memory_region_opts_t memopts = { 0 };
+ memopts.region = (void*) 0;
+ memopts.bufferable = 0;
+ memopts.cacheable = 1;
+ memopts.sharable = 1;
+ memopts.tex = 0;
+ memopts.size = REGION_SIZE_4Gb;
+ memopts.perms = ACCESS_PERMS_FULL;
+ memopts.subregion_disable = 0;
+ memopts.executable = 1;
+ memopts.enable = 1;
+
+ mpu_configure_region(0, &memopts);
+ mpu_set_enabled(1);
+
+ ASSERT_EQ(MPU.rba_r, 1 << 4);
+ ASSERT_EQ(MPU.ras_r, 0x0306003F);
+
+ return 0;
+}