ndless os config
9 posts
• Page 1 of 1
ndless os config
Is there any way to access to the nspire OS configuration? For example, language, unit angle, ...
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless os config
The problem can (should?) be put the other way around, especially in your case where it's via a lua module.
What I mean is, TI already provides all these APIs to get (and set, in some cases) settings/config of a document, from Nspire Lua.
So, it would be easy to just call your own C function of your module that "receives" the lua value corresponding to what you want.
For instance you can look at
For the language, there is locale.name()
What I mean is, TI already provides all these APIs to get (and set, in some cases) settings/config of a document, from Nspire Lua.
So, it would be easy to just call your own C function of your module that "receives" the lua value corresponding to what you want.
For instance you can look at
math.getEvalSettings()
(Returns a table of tables with the document settings that are currently being used by math.eval. These settings are equivalent to the current document settings unless a call has been made to setEvalSettings). Cf the page https://wiki.inspired-lua.org/math.setEvalSettings that has more info too.For the language, there is locale.name()
MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)My calculator programs
Mes programmes pour calculatrices
-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 14820
- Images: 1131
- Joined: 01 Jun 2007, 00:00
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- Twitter: adriweb
- GitHub: adriweb
Re: ndless os config
Adrien, the "new" KhiCAS UI (ported from the Numworks UI) does not use lua anymore : the idea is to have the same codebase for several calculator brands (with a few ifdef of course), at least for the Numworks and the TI.
That's why it would be nice to get the language from a C call, otherwise I will have to ask the user English or French when he run KhiCAS for the first time, or set it to French and leave the user press ctrl s and select English (current behavior).
That's why it would be nice to get the language from a C call, otherwise I will have to ask the user English or French when he run KhiCAS for the first time, or set it to French and leave the user press ctrl s and select English (current behavior).
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless os config
OK, if not from a Lua module anymore (I thought for graphics etc. you just "drew on screen" with a backup buffer etc.), then the Lua stuff doesn't apply of course 
And it's more complicated now. The ndless sdk would have to impement that in an os-specific way, which isn't done right now afaik. No syscalls for it I think.
I'll let Vogtinator know about this topic.
Edit: getLangInfo() and getMode() from Basic would work -> https://www.manualslib.com/manual/37632 ... =48#manual ... if that's callable from ndless ?

And it's more complicated now. The ndless sdk would have to impement that in an os-specific way, which isn't done right now afaik. No syscalls for it I think.
I'll let Vogtinator know about this topic.
Edit: getLangInfo() and getMode() from Basic would work -> https://www.manualslib.com/manual/37632 ... =48#manual ... if that's callable from ndless ?
MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)My calculator programs
Mes programmes pour calculatrices
-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 14820
- Images: 1131
- Joined: 01 Jun 2007, 00:00
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- Twitter: adriweb
- GitHub: adriweb
Re: ndless os config
You could parse /phoenix/syst/settings/current.zip yourself, that's where the settings are stored (AFAICT).
It might be enough to use some undocumented syscalls to poke the calc engine, though I don't know how well that works and it might break in the future when the OS changes ABI.
It might be enough to use some undocumented syscalls to poke the calc engine, though I don't know how well that works and it might break in the future when the OS changes ABI.
- Code: Select all
#include <os.h>
#include <syscall.h>
...
char16_t input_w[] = u"nsolve(x-42=0,x)";
void *math_expr = nullptr;
int str_offset = 0;
int error = TI_MS_evaluateExpr_ACBER(NULL, NULL, (const uint16_t*)input_w, &math_expr, &str_offset);
if(error)
return 0;
char16_t *output_w;
error = TI_MS_MathExprToStr(math_expr, NULL, (uint16_t**)&output_w);
syscall<e_free, void>(math_expr); // Should be TI_MS_DeleteMathExpr
if(error)
return 0;
// Do something with output_w, it's u"42." here
syscall<e_free, void>(output_w);
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless os config
Thanks, it just works!
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless os config
Is there any way to set the RTC? I tried
but it does not work.
- Code: Select all
unsigned NSPIRE_RTC_ADDR=0x90090000;
* (volatile unsigned *) NSPIRE_RTC_ADDR = (h*60+m)*60;
but it does not work.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless os config
You have to write to 0x90090008, see https://hackspire.org/index.php?title=M ... _.28RTC.29
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: ndless os config
Indeed!
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
9 posts
• Page 1 of 1
Return to Native: Ndless, Linux, ...
Who is online
Users browsing this forum: ClaudeBot [spider] and 3 guests