aboutsummaryrefslogtreecommitdiff
path: root/tests/test-mkmif.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2016-07-05 22:45:35 -0400
committerPaul Selkirk <paul@psgd.org>2016-07-05 22:45:35 -0400
commit30f8e4e85b6a337291b09d55d8edc15e422b6341 (patch)
tree19199dd47bb98e18a96281d34e35d1971565fc72 /tests/test-mkmif.c
parente1c57eff41a57b8a3f16e5d652b5598d75887a21 (diff)
Attempt to add resource management, for multiple cores of the same type.
Find a suitable core, and mark it busy. Don't forget to release it as soon as you're done. This has a knock-on effect of un-const'ing core arguments and struct fields in a lot of places, and it moves some core checks around.
Diffstat (limited to 'tests/test-mkmif.c')
-rw-r--r--tests/test-mkmif.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test-mkmif.c b/tests/test-mkmif.c
index a382cf6..ab5801e 100644
--- a/tests/test-mkmif.c
+++ b/tests/test-mkmif.c
@@ -19,7 +19,7 @@ typedef union {
uint32_t word;
} byteword_t;
-static hal_error_t sclk_test(const hal_core_t *core, const uint32_t divisor)
+static hal_error_t sclk_test(hal_core_t *core, const uint32_t divisor)
{
uint32_t readback;
hal_error_t err;
@@ -41,7 +41,7 @@ static hal_error_t sclk_test(const hal_core_t *core, const uint32_t divisor)
return HAL_OK;
}
-static hal_error_t init_test(const hal_core_t *core)
+static hal_error_t init_test(hal_core_t *core)
{
hal_error_t err;
@@ -55,7 +55,7 @@ static hal_error_t init_test(const hal_core_t *core)
return HAL_OK;
}
-static hal_error_t write_test(const hal_core_t *core)
+static hal_error_t write_test(hal_core_t *core)
{
uint32_t write_data;
uint32_t write_address;
@@ -78,7 +78,7 @@ static hal_error_t write_test(const hal_core_t *core)
return HAL_OK;
}
-static hal_error_t read_test(const hal_core_t *core)
+static hal_error_t read_test(hal_core_t *core)
{
uint32_t read_data;
uint32_t read_address;
@@ -101,7 +101,7 @@ static hal_error_t read_test(const hal_core_t *core)
return HAL_OK;
}
-static hal_error_t write_read_test(const hal_core_t *core)
+static hal_error_t write_read_test(hal_core_t *core)
{
uint32_t data;
uint32_t readback;
@@ -131,7 +131,7 @@ static hal_error_t write_read_test(const hal_core_t *core)
int main(void)
{
- const hal_core_t *core = hal_core_find(MKMIF_NAME, NULL);
+ hal_core_t *core = hal_core_find(MKMIF_NAME, NULL);
if (core == NULL) {
printf("MKMIF core not present, not testing.\n");