π
<-
Chat plein-écran
[^]

hardware control

C, C++, ASM...
En ligne

hardware control

Message non lude parisse » 05 Juin 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: Tout sélectionner
...
    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: Tout sélectionner
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).
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 77.8%
 
Messages: 3511
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: hardware control

Message non lude critor » 05 Juin 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
Avatar de l’utilisateur
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Prochain niv.: 42.2%
 
Messages: 41493
Images: 14577
Inscription: 25 Oct 2008, 00:00
Localisation: Montpellier
Genre: Homme
Calculatrice(s):
MyCalcs profile
YouTube: critor3000
Twitter/X: critor2000
GitHub: critor


Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 12 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1654 utilisateurs:
>1611 invités
>38 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)