Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

problem of create SWI

$
0
0

I'm trying to create SWI and see "hello" tree times... 

You can see so simple code below.

but when I did debug I can't see anything in console window. 

Do you know what happen? Please help me....


#include <xdc/std.h>

#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/knl/Swi.h>

#include <ti/sysbios/BIOS.h>

#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>

/*
* ======== taskFxn ========
*/

Swi_Handle swi0;
Semaphore_Handle sem0;

Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");

Task_sleep(10);

System_printf("exit taskFxn()\n");
}

Void sayHello(UArg arg0, UArg arg1);
/*
* ======== main ========
*/
Int main()
{
Swi_Params swiParams;
Swi_Params_init(&swiParams);
swiParams.arg0 = 1;
swiParams.arg1 = 0;
swiParams.priority= 1;
swiParams.trigger = 0;
swi0 = Swi_create(sayHello,&swiParams, NULL);

System_printf("enter main()\n");

sem0 = Semaphore_create(0, NULL, NULL);

BIOS_start(); /* does not return */
return(0);
}

Void sayHello(UArg arg0, UArg arg1)
{
int i= 0;
for(i= 0; i<3; i++)
System_printf("Hello\n");
}


I really appreciate any help you can provide.


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>