You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#11
Re: Interrupts and new gccvb
Posted on: 2007/7/17 15:43
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Hi, as I thought it was a problem with the crt0.s not being saving the contents of the registries at the moment of calling the interrupt, and as you pointed DogP, the reti instruction is which restores PSW, and the interrupt handler in the new crt0 wasn't executing it. I will send David the crt0.s I fixed so he can put it in the gccvb source :-).

Thanks again for your help DogP.

jorgeche
Top

#12
Re: Interrupts and new gccvb
Posted on: 2007/7/17 17:03
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Cool... could you send it to me too? My email address is in my profile. Thanks,

DogP
Top

#13
Re: Interrupts and new gccvb
Posted on: 2007/7/17 17:08
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Sure, check your mail.

jorgeche
Top

#14
Re: Interrupts and new gccvb
Posted on: 2007/7/17 18:30
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Thanks... I'll try it out when I get a chance.

DogP
Top

#15
Re: Interrupts and new gccvb
Posted on: 2008/2/23 1:40
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder
Hi jorgeche,

Could you post and attach the fixed crt0.s.

Thanks!
Top

#16
Re: Interrupts and new gccvb
Posted on: 2008/2/24 3:06
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Sure, here it is.

Attach file:


s crt0.s Size: 8.34 KB; Hits: 229
Top

#17
Re: Interrupts and new gccvb
Posted on: 2008/3/6 20:03
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
Do I still need to put the asm("add 4,r3"); in my code when using this new crt0?

Also, I get a compiler error "multiple definition of 'tim_vector' " after using the new one... How should I define my function now?

Thanks,
DanB

Edit:
Hmm, nevermind, I got it. And it seems like it works without any inline asm.
Edited by DanB on 2008/3/6 20:58
Top

#18
Re: Interrupts and new gccvb
Posted on: 2008/4/5 21:27
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
I can't get this to work on the real hardware. In reality boy, it works but only without the asm line, but on hw it doesn't work either with or without it. I am using the new crt0 and my code looks like in jorgeche's post.

Any ideas would be appreciated.

Thanks
Top

#19
Re: Interrupts and new gccvb
Posted on: 2008/4/6 15:01
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (12 Years) App Coder

#define REG_SDLR    *(volatile u8*)(0x02000010)
#define REG_SDHR    *(volatile u8*)(0x02000014)
#define REG_SCR    *(volatile u8*)(0x02000028)

#define K_MASK  0xFFFC

u16 __key_curr 0__key_prev 0;

void key_poll()
{
    
REG_SCR = (S_INTDIS S_HW);
    while (
REG_SCR S_STAT);

    
__key_prev__key_curr;
    
__key_curr= ((REG_SDHR << ) | REG_SDLR) & K_MASK;
}


Try this.
Edited by dasi on 2009/4/13 19:15
Top

#20
Re: Interrupts and new gccvb
Posted on: 2008/4/6 23:15
VUE(xpert)
Joined 2003/9/3
Sweden
442 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
Thanks dasi, that works for reading the pad. And just for the record, it turned out my problems didn't have anything to do with the interrupts.
Top

 Top   Previous Topic   Next Topic


Register To Post