Search found 34 matches
- Mon Sep 03, 2018 5:41 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
I managed to make the import statement work how I want to ("import test" imports from the file test.py), however I found that it doesn't close the file if an error happens (syntax error, or out of memory error for example). I just overrode the close, read and open functions in reader.c with the Casi...
- Mon Sep 03, 2018 10:59 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
There you go: https://youtu.be/X9MSxI2BVK0 If you want to try it yourself, you can always use the emulator: - Download the emulator at https://edu.casio.com/freetrial/fr/freetrial_form.php?dl_FILE_NO=19653&LANGUAGE=1 - Download the program (.g1a) at https://www.planet-casio.com/Fr/programmes/voir_un...
- Sun Sep 02, 2018 7:28 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
Thanks! I implemented mp_import_stat but didn't know about mp_lexer_new_from_file. I'll see in the Unix port how it implements it.
Also, I put you in the credits for my port as a thanks for your help, if you don't mind
Also, I put you in the credits for my port as a thanks for your help, if you don't mind
- Sun Sep 02, 2018 11:49 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
First of all do you have an actual OS with a file system that supports fopen? Not fopen() itself, however there are equivalent functions: - Bfile_OpenFile (gets the file handle) - Bfile_ReadFile (reads from the file) - Bfile_CloseFile (closes the open file handle). The OS does have a file system, a...
- Sat Sep 01, 2018 2:40 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
I looked in builtinimport.c, and in objmodule.c but I didn't find anything relating to actually opening the file. I guess there is an fopen() somewhere, however the only instance of fopen() is in emitglue.c and it writes to the file, it doesn't read from it.
- Fri Aug 31, 2018 11:58 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
Thanks; as this editor is aimed at students, this kind of error reporting is very important. In my case, I spotted my error right away, but a student might not. I could probably do it myself, though all I need is the column (as I already have the line), then I'd hook into the mp_obj_print_exception(...
- Fri Aug 31, 2018 9:57 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
So part of it is a bug in micropython (because it is doubling the size of lists, consuming even more memory, when there is no memory left)? Also, is there a way to make errors display the character? I just did a beginner error (using = instead of ==), but MPy doesn't show me exactly where it happene...
- Thu Aug 30, 2018 9:12 pm
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
It just uses this function instead of the default one, why? Anyway, I still haven't resolved this issue, but I do know it has absolutely nothing to do with MPy. Even a small program written from scratch has this error. Why I'm posting is because I'm running into a memory error. I tried to get the av...
- Sat Aug 11, 2018 4:35 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
Seems the pow() function is broken. The problem comes from this line: dec_val *= MICROPY_FLOAT_C_FUN(pow)(10, exp_val); For input 1.0, dec_val is 10.0000000, exp_val is -1, and the result of pow(10, exp_val) is... -0.0000. This seemingly happens for all inputs of pow(). Weirdly, if I remove my print...
- Thu Aug 09, 2018 4:40 am
- Forum: Development of MicroPython
- Topic: How do I make a port of MicroPython for Casio calculators?
- Replies: 66
- Views: 59204
Re: How do I make a port of MicroPython for Casio calculators?
I can't put breakpoints so I did the "manual" method with good old print(). Anyway, I put print statements everywhere (beginning of mp_execute_bytecode, before for loop, beginning of for loop, beginning of switch...): when I type an integer, all print statements are executed, however when I type a d...