Altera_Forum
Honored Contributor
14 years agoalt_getchar returning wrong value
int main()
{
int noia = 0;
alt_putstr("Proc 2!\n");
/* get the mutex device handle */
alt_mutex_dev* mutex = altera_avalon_mutex_open( "/dev/mutex" );
/* acquire the mutex, setting the value to one */
altera_avalon_mutex_lock( mutex, 1 );
if(altera_avalon_mutex_is_mine(mutex))
{
alt_printf("%x\n", IORD_32DIRECT(SHARED_MEM_BASE, 0x00));
noia = alt_getchar();
alt_printf("%x\n", noia);
if (noia == 1)
altera_avalon_mutex_unlock( mutex );
}
return 0;
} This is my code, however alt_getchar() is returning a wrong value, not what i typed