git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15313 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2022-01-02 16:14:39 +00:00
parent 0a6a7da34b
commit 4a2094d06b
2 changed files with 9 additions and 7 deletions

View File

@ -111,8 +111,8 @@ static const sb_config_t sb_config2 = {
/* Sandbox objects.*/ /* Sandbox objects.*/
sb_class_t sbx1, sbx2; sb_class_t sbx1, sbx2;
static THD_WORKING_AREA(waUnprivileged1, 512); static THD_WORKING_AREA(waUnprivileged1, 1024);
static THD_WORKING_AREA(waUnprivileged2, 512); static THD_WORKING_AREA(waUnprivileged2, 1024);
static thread_t *sb1tp, *sb2tp; static thread_t *sb1tp, *sb2tp;
@ -155,7 +155,7 @@ static void SBHandler(eventid_t id) {
* Application entry point. * Application entry point.
*/ */
int main(void) { int main(void) {
event_listener_t el0, el1, el2; event_listener_t elsb;
vfs_node_c *np; vfs_node_c *np;
msg_t ret; msg_t ret;
static const evhandler_t evhndl[] = { static const evhandler_t evhndl[] = {
@ -310,11 +310,9 @@ int main(void) {
} }
/* /*
* Listening to sandbox and card events. * Listening to sandbox events.
*/ */
chEvtRegister(&sdmon_inserted_event, &el0, (eventid_t)0); chEvtRegister(&sb.termination_es, &elsb, (eventid_t)2);
chEvtRegister(&sdmon_removed_event, &el1, (eventid_t)1);
chEvtRegister(&sb.termination_es, &el2, (eventid_t)2);
/* /*
* Normal main() thread activity, in this demo it monitors the user button * Normal main() thread activity, in this demo it monitors the user button

View File

@ -89,6 +89,7 @@ static void tmrfunc(virtual_timer_t *vtp, void *p) {
* @notapi * @notapi
*/ */
void sdmonInit(void) { void sdmonInit(void) {
static event_listener_t el0, el1;
/* Activates the SDC driver using default configuration.*/ /* Activates the SDC driver using default configuration.*/
sdcStart(&SDCD1, NULL); sdcStart(&SDCD1, NULL);
@ -96,6 +97,9 @@ void sdmonInit(void) {
chEvtObjectInit(&sdmon_inserted_event); chEvtObjectInit(&sdmon_inserted_event);
chEvtObjectInit(&sdmon_removed_event); chEvtObjectInit(&sdmon_removed_event);
chEvtRegister(&sdmon_inserted_event, &el0, (eventid_t)0);
chEvtRegister(&sdmon_removed_event, &el1, (eventid_t)1);
sdmon_ready = false; sdmon_ready = false;
cnt = POLLING_INTERVAL; cnt = POLLING_INTERVAL;
chVTSet(&tmr, TIME_MS2I(POLLING_DELAY), tmrfunc, (void *)&SDCD1); chVTSet(&tmr, TIME_MS2I(POLLING_DELAY), tmrfunc, (void *)&SDCD1);