• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision12993 (tree)
Zeit2019-09-15 23:55:04
Autorgdisirio

Log Message

Debugging....

Ändern Zusammenfassung

Diff

--- trunk/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT/main.c (revision 12992)
+++ trunk/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT/main.c (revision 12993)
@@ -16,6 +16,7 @@
1616
1717 #include <stdint.h>
1818 #include <stdbool.h>
19+#include <stddef.h>
1920
2021 #include "sbuser.h"
2122
@@ -39,6 +40,9 @@
3940 }
4041 #endif
4142 while (true) {
42- sbSleepMilliseconds(500);
43+ msg_t msg = sbMsgWait();
44+ sbFileWrite(1U, (const uint8_t *)"Hello World!!\r\n", 15U);
45+ sbMsgReply(msg);
46+// sbSleepMilliseconds(500);
4347 }
4448 }
--- trunk/demos/STM32/RT-STM32L476-DISCOVERY-SB_HOST/main.c (revision 12992)
+++ trunk/demos/STM32/RT-STM32L476-DISCOVERY-SB_HOST/main.c (revision 12993)
@@ -22,6 +22,9 @@
2222 #include "chprintf.h"
2323 #include "sbhost.h"
2424
25+/* SandBox object.*/
26+sb_class_t sbx1;
27+
2528 /*
2629 * LEDs blinker thread, times are in milliseconds.
2730 */
@@ -39,6 +42,7 @@
3942 chThdSleepMilliseconds(50);
4043 palSetLine(LINE_LED_RED);
4144 chThdSleepMilliseconds(200);
45+ (void) sbSendMessage(&sbx1, 0xF00F55AAU);
4246 }
4347 }
4448
@@ -58,7 +62,6 @@
5862 .stdout_stream = (SandboxStream *)&SD2,
5963 .stderr_stream = (SandboxStream *)&SD2
6064 };
61- sb_class_t sbx1;
6265
6366 (void)arg;
6467 chRegSetThreadName("unprivileged");
@@ -108,7 +111,7 @@
108111 sdStart(&SD2, NULL);
109112
110113 /* Creating the blinker thread.*/
111- chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO,
114+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO+10,
112115 Thread1, NULL);
113116
114117 /* Creating the unprivileged thread.*/
--- trunk/os/sb/host/sbapi.h (revision 12992)
+++ trunk/os/sb/host/sbapi.h (revision 12993)
@@ -57,6 +57,10 @@
5757 */
5858 struct SandboxStreamVMT {
5959 /**
60+ * @brief Object instance offset.
61+ */
62+ size_t instance_offset;
63+ /**
6064 * @brief Stream write buffer method.
6165 */
6266 size_t (*write)(void *instance, const uint8_t *bp, size_t n);
--- trunk/os/sb/host/sbhost.c (revision 12992)
+++ trunk/os/sb/host/sbhost.c (revision 12993)
@@ -117,8 +117,9 @@
117117
118118 /* Additional context information.*/
119119 sbcp->config = config;
120- chThdGetSelfX()->ctx.syscall.p = (const void *)sbcp;
121- chThdGetSelfX()->ctx.syscall.psp = __get_PSP();
120+ sbcp->tp = chThdGetSelfX();
121+ sbcp->tp->ctx.syscall.p = (const void *)sbcp;
122+ sbcp->tp->ctx.syscall.psp = __get_PSP();
122123
123124 /* Jumping to the unprivileged code.*/
124125 port_unprivileged_jump(pc, psp);
Show on old repository browser