Search found 54 matches

by BramPeeters
Thu Sep 27, 2018 7:21 pm
Forum: Development of MicroPython
Topic: How to get a ll out of an objint (inverse of mp_obj_new_int_from_ll)
Replies: 4
Views: 3834

Re: How to get a ll out of an objint (inverse of mp_obj_new_int_from_ll)

My int's are 32 bit and long long's 64 bit, so thank you very much !
by BramPeeters
Thu Sep 27, 2018 5:04 pm
Forum: Development of MicroPython
Topic: How to get a ll out of an objint (inverse of mp_obj_new_int_from_ll)
Replies: 4
Views: 3834

How to get a ll out of an objint (inverse of mp_obj_new_int_from_ll)

Hi, After creating an objint with mp_obj_new_int_from_ll, is there a way to get the long long out of there afterwards? At the moment I am only seeing the mp_int_t mp_obj_get_int(mp_const_obj_t arg) function, but that returns an mp_int_t which is not suppose to have the long long size. Is mp_obj_int_...
by BramPeeters
Mon Sep 24, 2018 10:01 am
Forum: Development of MicroPython
Topic: [SOLVED]Executing a method specified as a string of an mp_obj_t in C
Replies: 9
Views: 4892

Re: [SOLVED]Executing a method specified as a string of an mp_obj_t in C

No mostly thinking out loud, sorry.

But now I was looking for a way to purge the learned qstrings from
mp_state_ctx.vm.last_pool
to start 'fresh'.

As far as I can see there is not (yet) a function to do that ? So i would have to walk through the pool list myself to clear each pool ?
by BramPeeters
Sun Sep 23, 2018 10:35 pm
Forum: Development of MicroPython
Topic: [SOLVED]Executing a method specified as a string of an mp_obj_t in C
Replies: 9
Views: 4892

Re: [SOLVED]Executing a method specified as a string of an mp_obj_t in C

What do you mean by your last sentence? I don't currently have that situation (yet) but i can imagine having a situation where the method you need call is a string parameter (eg maybe it arrives from a remote server as a command or something ). In that case it will be hard for the server to know th...
by BramPeeters
Sun Sep 23, 2018 1:32 pm
Forum: Development of MicroPython
Topic: [SOLVED]Executing a method specified as a string of an mp_obj_t in C
Replies: 9
Views: 4892

Re: [SOLVED]Executing a method specified as a string of an mp_obj_t in C

Q strings can never be deleted so they will take up increasing amount of ram if you keep on introducing new strings Yes, but in this case they are not new strings, they are method names that already exist as a qstring. If i recall correctly qstr_from_str will first search if the string you pass alr...
by BramPeeters
Fri Sep 21, 2018 8:50 am
Forum: Development of MicroPython
Topic: [SOLVED]Executing a method specified as a string of an mp_obj_t in C
Replies: 9
Views: 4892

Re: Executing a method specified as a string of an mp_obj_t in C

Ah great ! That looks promising indeed ! Thanks!

('Also you have to use qstrings not strings.' -> Ok, so qstr_from_str/qstr_from_strn is my friend )
by BramPeeters
Thu Sep 20, 2018 11:00 pm
Forum: Development of MicroPython
Topic: [SOLVED]Executing a method specified as a string of an mp_obj_t in C
Replies: 9
Views: 4892

[SOLVED]Executing a method specified as a string of an mp_obj_t in C

Hi, I am looking for a way get 'PyObject_CallMethod' like functionality in micropython. That is, I have an mp_obj_t and a method name (as a string), and now I would like to execute that function (or fail if the mp_obj_t does not support that particular method) (*). Looking at the callstack coming ou...
by BramPeeters
Tue Sep 18, 2018 7:06 pm
Forum: Development of MicroPython
Topic: Bug in execute_from_str
Replies: 13
Views: 7677

Re: Bug in execute_from_str

I don't really have insight in which one would be better (empty string or NULL), but i am just wondering about the usage of the hard coded 0/1 value versus the 'named' values MP_QSTR_NULL/MP_QSTR_ Reason being that i need to pass an empty string object myself, so then I remembered this fix and I sta...
by BramPeeters
Tue Sep 18, 2018 4:04 pm
Forum: Development of MicroPython
Topic: Bug in execute_from_str
Replies: 13
Views: 7677

Re: Bug in execute_from_str

Additional related question: I just saw that the fix was modified again with the qstr src_name = 0/*MP_QSTR_*/; vs qstr src_name = 1/*MP_QSTR_*/; Which begs the question, why the direct hard coded value and not qstr src_name = MP_QSTR_; I just tried and it compiles and runs fine resolving to the cor...
by BramPeeters
Mon Sep 17, 2018 9:05 pm
Forum: Development of MicroPython
Topic: Micropython port for Atmel SAME70Q20
Replies: 5
Views: 4092

Re: Micropython port for Atmel SAME70Q20

I did it for an stm32f429 (cortext m4) so I cant really help with the Atmel things, but some ramblings on things I encountered.... You can look at the cc3200 port for integration with freertos. I would not first try to do it native , and then freertos as you seem to suggest. Go for freertos integrat...