π
<-
Chat plein-écran
[^]

hardware control

C, C++, ASM...

hardware control

Unread postby parisse » 05 Jun 2020, 20:02

I made some progresses in order to "simulate" OFF/ON inside KhiCAS by setting the backlight to 0. If a student enters KhiCAS during the math course and presses OFF then ON 5 minutes later, the current code (see below) is ok, but if the calc stays like this a few days, this will probably drains the batteries too much. I wonder how I could improve it in order to decrease power consumption.
The current code looks like this
Code: Select all
...
    if (allow_suspend && nspire_ctrl && on_key_pressed()){
      nspire_ctrl=false;
      while (on_key_pressed())
   msleep(10);
      // somewhat OFF by setting LCD to 0
      unsigned NSPIRE_CONTRAST_ADDR=0x900f0020;
      unsigned oldval=*(volatile unsigned *)NSPIRE_CONTRAST_ADDR;
      *(volatile unsigned *)NSPIRE_CONTRAST_ADDR=0x100;
      while (!on_key_pressed())
   msleep(100);
      *(volatile unsigned *)NSPIRE_CONTRAST_ADDR=oldval;
      statusline(0);
      sync_screen();
      continue;
    }
...

I also tried to write to the led (I have introduced the read32 and write32 commands to make tries easy inside the KhiCAS shell), but it seems to be locked:
Code: Select all
16=>=>
l=0x90110b00
a=read32(l)
b=0b1010011
write32(l,b)

read32(l) stills return 0x1643
(N.B. 16=>=> is a KhiCAS command to display integers in hexa).
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 1%
 
Posts: 2013
Joined: 13 Dec 2013, 16:35
Gender: Not specified

Re: hardware control

Unread postby critor » 05 Jun 2020, 20:28

Yes, on recent Nspire versions and hardwares, the LED port is locked by at least 2 other ports if I remember well.
You had to write to those other ports to unlock it, it may not work anymore.

If I remember well, information about these ports is/was available on Cemetech and Omnimaga.

Although, if you unlock the LED, the calculator is going to reboot some seconds after you're back to the OS
(after exiting the Ndless program, KhiCAS in your case)
. Even if you reset the LED to its original state and relock it before exiting.
So unlocking the LED is either not a solution, or not enough.
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 6%
 
Posts: 35501
Images: 9485
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
Class: Lycée
YouTube: critor3000
Twitter: critor2000
Facebook: critor.ti


Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 3 guests

-
Search
-
Featured topics
L'OS 5.5 de la TI-83 Premium CE / 84 Plus CE supprime l'assembleur - la plupart des jeux et certains programme ne fonctionneront plus
Omega, le fork étendant les capacités de ta NumWorks, même en mode examen !
Découvre les nouvelles fonctionnalités en Python de l'OS 5.5 pour la 83PCE/84+C-T Python Edition
Comparaisons des meilleurs prix pour acheter sa calculatrice !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...

Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
601 utilisateurs:
>596 invités
>0 membre
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)