Search found 83 matches: casio

Searched query: casio

by Zezombye
Sat Dec 01, 2018 5:30 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

No, it's the string "from xxx import *": char str[30]; char filename[13]; strcpy(filename, _sFile); filename[strlen(filename)-3] = '\0'; sprintf(str, "from %s import *\r", filename); for (int k = 0; str[k]; k++) { str[k] = tolower2(str[k]); } _iAppMode = SHELL; mpy_main(str); The actual text of the ...
by jickster
Sat Dec 01, 2018 4:57 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

Zezombye wrote:Thanks, works fine now :D
Thank god. I was gonna be exasperated otherwise.

I’ll address your REPL issue next.

To be clear, does your

Code: Select all

char * text
represent ALL the lines of a .py script?


Sent from my iPhone using Tapatalk Pro
by jickster
Sat Dec 01, 2018 4:28 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

You forgot to call mp_stack_ctrl_init() which takes care of what you’re trying to do with the variable stack_dummy.


Sent from my iPhone using Tapatalk Pro
by Zezombye
Sat Dec 01, 2018 4:13 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

There you go: int mpy_main(char *text) { mp_stack_set_limit(256); int heapLen = 32768; #if MICROPY_ENABLE_GC heap = malloc(heapLen); #endif if (heap == NULL) { int key; locate(1,1); Print("Couldn't alloc!"); GetKey(&key); } ML_clear_vram(); ML_display_vram(); shell_init(); readline_index = 0; initNb...
by jickster
Sat Dec 01, 2018 3:56 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

How do I make a port of MicroPython for Casio calculators?

Create a super simple script and import it like:

Code: Select all

a = 1
Does it work?

I think what may be happening is you’re importing something too big.


Sent from my iPhone using Tapatalk Pro
by Zezombye
Sat Dec 01, 2018 3:53 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

Calling mp_stack_set_limit(2048) at the beginning of mpy_main() doesn't seem to fix the "infinite loop" problem (I also tried with 256). Doing "reset&run execution" on the SDK gives the error "reserved instruction exception by code read access at 003317F8" which is the function nlr_jump_fail: 003317...
by jickster
Sat Dec 01, 2018 3:23 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

mp_pystack_init() is NOT the right function. That refers to something else.

mp_stack_set_limit(mp_uint_t limit) takes in a stack SIZE limit.


Sent from my iPhone using Tapatalk Pro
by Zezombye
Sat Dec 01, 2018 3:03 am
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

Re: How do I make a port of MicroPython for Casio calculators?

I can't use the mp_pystack_init() function though, as I can't know the absolute stack addresses (unless there's another way, but whatever, it seems there's only 3k of stack available, not gonna bother when I've got 32kb :p). Do you have any idea for my other problems (raising a keyboardinterrupt fro...
by jickster
Fri Nov 30, 2018 4:52 pm
Forum: Development of MicroPython
Topic: How do I make a port of MicroPython for Casio calculators?
Replies: 66
Views: 11820

How do I make a port of MicroPython for Casio calculators?

You have to call a c function to set the amount of C stack available to uPy.


Sent from my iPhone using Tapatalk Pro