aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c
diff options
context:
space:
mode:
authorisiora <none@example.com>2018-01-19 14:15:25 +0000
committerisiora <none@example.com>2018-01-19 14:15:25 +0000
commit9b492024bd2a29f1be65eece6506eb2939b1681c (patch)
treeb36b3b51e340cbbe45ba3fe789eb76e706e5f777 /demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c
parentd1fbd41782f30da68c7b67ca75a0cbee69fff133 (diff)
downloadChibiOS-9b492024bd2a29f1be65eece6506eb2939b1681c.tar.gz
ChibiOS-9b492024bd2a29f1be65eece6506eb2939b1681c.tar.bz2
ChibiOS-9b492024bd2a29f1be65eece6506eb2939b1681c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11351 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c')
-rwxr-xr-xdemos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c
index c77588deb..0b21f67c1 100755
--- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c
+++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/main.c
@@ -19,6 +19,7 @@
#include "rt_test_root.h"
#include "oslib_test_root.h"
#include "chprintf.h"
+#include "smcclient.h"
/*
* LED blinker thread, times are in milliseconds.
*/
@@ -50,14 +51,11 @@ static const SerialConfig sdcfg = {
UART_MR_PAR_NO
};
-msg_t smcInvokeService(msg_t handle, void *data);
-
/*
* Application entry point.
*/
int main(void) {
-
- asm("bkpt #0\n\t");
+ smc_service_t smcsvc;
/*
* System initializations.
* - HAL initialization, this also initializes the configured device drivers
@@ -82,16 +80,24 @@ int main(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO-1, Thread1, NULL);
/*
- * Call the null secure service
+ * Call the dummy secure service
*/
- chprintf((BaseSequentialStream*)&SD0, "Calling the 'null' secure service\n\r");
- //smcInvokeService(1, (void *)2);
+ chprintf((BaseSequentialStream*)&SD0, "Calling the 'dummy' secure service\n\r");
+ /* Retrieve the service handle by name */
+ smcsvc = (smc_service_t) smcInvokeService(
+ SMC_HND_GET, (smc_params_area_t)"DummyTrustedService",
+ sizeof "DummyTrustedService");
/*
* Normal main() thread activity, in this demo it does nothing except
- * sleeping in a loop and check the button state.
+ * calling periodically the dummy service and check the button state.
*/
while (true) {
+ msg_t r;
+
+ /* Invoke the service */
+ r = smcInvokeService(smcsvc, (smc_params_area_t)"HELO", sizeof "HELO");
+ chprintf((BaseSequentialStream*)&SD0, "Call result: %d\r\n", r);
if(!palReadPad(PIOB, PIOB_USER_PB)) {
#if 1
test_execute((BaseSequentialStream *)&SD0, &rt_test_suite);