SIO init now works from VM.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15737 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2022-08-25 07:42:13 +00:00
parent bb4ca5e19c
commit c275fbeee7
2 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,11 @@ int main(void) {
halInit();
chSysInit();
/*
* Activates the Serial or SIO driver using the default configuration.
*/
sioStart(&SIOD1, NULL);
/* Creating a blinker thread.*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO+10, Thread1, NULL);

View File

@ -60,10 +60,10 @@ static void vuart_cb(SIODriver *siop) {
void sb_api_vio_uart(struct port_extctx *ectxp) {
sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
uint32_t sub = ectxp->r0;
uint32_t unit = ectxp->r1;
ectxp->r0 = (uint32_t)CH_RET_INNER_ERROR;
ectxp->r1 = (uint32_t)0;
uint32_t sub = ectxp->r0;
uint32_t unit = ectxp->r1;
const vio_uart_unit_t *unitp;
if (unit >= sbp->config->vioconf->uarts->n) {