Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: apcalc on August 31, 2010, 10:29:14 pm

Title: Nspire keypress errors...
Post by: apcalc on August 31, 2010, 10:29:14 pm
Ever since I set up my new computer, I have been experiencing serious problems with keypresses in the programs I am compiling.  I have found that the programs themselves are running slower (I have had to lower my key delay by about half) and pressing a key for an extended period of time, say 5 seconds, causes the calculator to completly freeze...

Does anyone know what could be causing this.  I have tried compiling Block Dude, Trapped, the Ndless demo, Ncaster, and bwang's picture viewer and the problem persists in each case. 

Also, would someone be willing to compile Block Dude for the Nspire CAS for me? I had a compiling error in the version I uploaded to ticalc.org (I used the NON CAS header), and I need to upload a new version ASAP.  I have attached a .zip of a skeleton containing the block dude files.
Title: Re: Nspire keypress errors...
Post by: bwang on August 31, 2010, 10:36:33 pm
Are the problems on the emulator or on hardware?
If someone hasn't done so yet, I'll compile bd for you once I get back to my dorm. I don't have a development environment set up on the campus system yet.
Title: Re: Nspire keypress errors...
Post by: apcalc on August 31, 2010, 10:37:47 pm
Both, I have only experienced them on hardware, but in an e-mail conversation with someone using a fixed version for the CAS, they told me they had problems too.
Title: Re: Nspire keypress errors...
Post by: _player1537 on September 01, 2010, 12:06:07 am
I just did a Make in the file directory.  Or did I miss what we were supposed to do?
Title: Re: Nspire keypress errors...
Post by: ExtendeD on September 01, 2010, 04:33:05 am
apcalc, I'm not sure if this is related to your issue, but could you try to add the "volatile" keyword to the definition of isKeyPressed in common.h ?

Code: [Select]
#define isKeyPressed(key)       (!((*(volatile short*)(KEY_MAP + (key).row)) & (key).col))
The behavior may be  undefined with some versions of GCC without it.

Also, thanks _player1537 for compiling this for me :)
Title: Re: Nspire keypress errors...
Post by: apcalc on September 01, 2010, 04:12:22 pm
ExtendeD, that seems to fix the issue for me.  Thanks! :D

Another intresing thing that happened while I had this problem was that the "home" key was completly unresponsive, unlike the other keys, which would only freeze up after holding them down for a little while.

Also, thanks _player1537 for compiling this for me!
Title: Re: Nspire keypress errors...
Post by: bwang on September 01, 2010, 04:13:16 pm
Hmm...I should update the skeleton accordingly.
Title: Re: Nspire keypress errors...
Post by: DJ Omnimaga on September 01, 2010, 05:53:43 pm
Ever since I set up my new computer, I have been experiencing serious problems with keypresses in the programs I am compiling.
My concern is the first part of this sentence, though. I am curious why this problem seemed dependent on the computer setup o.o? Is it just because you were using different software versions before?
Title: Re: Nspire keypress errors...
Post by: apcalc on September 01, 2010, 05:57:02 pm
This problem is not caused by my computer OS (thankfully)!

Before my computer was reset, I used to compile/store my programs in the Ndless folder, using the header files from Ndless.

When I started fresh on this computer, I started using bwang's skeleton, which did not contain "volatile" in the "isKeyPressed(" function.  The problem was caused because I was including a different header.
Title: Re: Nspire keypress errors...
Post by: DJ Omnimaga on September 01, 2010, 06:06:08 pm
Ooh ok, I'm glad this is not a computer issue. It would suck if people Nspire dev would be hindered by such dependencies x.x
Title: Re: Nspire keypress errors...
Post by: ExtendeD on September 02, 2010, 03:30:52 am
The behavior probably depends on the version of GCC.
Title: Re: Nspire keypress errors...
Post by: calc84maniac on September 02, 2010, 09:14:59 am
Also probably depends on the optimization level used.