Search found 34 matches
- Thu Jan 03, 2019 1:15 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59308
Re: How do I make a port of MicroPython for Casio calculators?
I "solved" the shell problem (really it's more like a workaround, it still kind of prints character by character, but I have no idea how to avoid that). Basically I first reprogrammed shell_draw() to only execute in case of a new line (\n or character wrapping). This works fine, but now I also have ...
- Tue Dec 04, 2018 4:48 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59308
Re: How do I make a port of MicroPython for Casio calculators?
Yeah, I knew about this port - in fact Casio not releasing MPy for monochrome calcs is why I'm doing this port myself :p
Shame they used the big font though, you could fit much more letters in the screen.
Shame they used the big font though, you could fit much more letters in the screen.
- Sun Dec 02, 2018 6:32 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59308
Re: How do I make a port of MicroPython for Casio calculators?
I refactored that because it was a simple way to automatically send the string "from xxx import *" to the shell. So pyexec_friendly_repl(char *text), through a bunch of ifs, ultimately calls int readline(vstr_t *line, const char *prompt, char *text), which is the following function: int readline_ind...
- 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: 59308
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 ...
- Sat Dec 01, 2018 4:34 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59308
- 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: 59308
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...
- 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: 59308
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...
- 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: 59308
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...
- Fri Nov 30, 2018 4:47 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59308
Re: How do I make a port of MicroPython for Casio calculators?
Thanks; I must have missed that #define when I skimmed over the mpconfig.h. I also thought MPy used the allocated memory as stack memory, instead of using actual stack memory. However, for some reason defining MICROPY_STACK_CHECK makes me unable to import any script; the shell simply hangs as if it ...
- Fri Nov 30, 2018 3:44 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59308
Re: How do I make a port of MicroPython for Casio calculators?
I can't really do without recursion though (in algorithms class, recursive functions are almost always studied). Sure, recursion eats memory, however MPy handles regular out-of-memory just fine: l = [] while True: l.append("12345678") https://i.imgur.com/EQ6DEc7.png Also, if the error is caused by b...