Search found 69 matches

by v923z
Mon Nov 13, 2017 8:44 pm
Forum: General Discussion and Questions
Topic: enabling/disabling interrupts in assembly
Replies: 2
Views: 675

Re: enabling/disabling interrupts in assembly

Robert,

Thanks for the pointer!

Zoltán
by v923z
Mon Nov 13, 2017 7:44 pm
Forum: General Discussion and Questions
Topic: enabling/disabling interrupts in assembly
Replies: 2
Views: 675

enabling/disabling interrupts in assembly

Hi all, In a critical section of my code, I have to toggle a couple of pins in assembly, because speed/accuracy is essential. I have separated this part of the code in a single function (I don't care about the overhead of calling the function), and decorated it with @micropython.asm_thumb But this i...
by v923z
Fri Jul 14, 2017 8:27 am
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2977

Re: retrieving timer ID

As far as I know you're the first to want to retrieve timer ID. A feature request is up to you but it may not get a high priority given that Python workrounds exist. I think I had a pull request in mind. The implementation is probably not too hard, I just have to find the time. While it is true tha...
by v923z
Thu Jul 13, 2017 3:43 pm
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2977

Re: retrieving timer ID

I think the problem here is that the argument to the timer callback is defined in the firmware to be the timer instance. The only way to add context (so far as I know) is via a bound method. I tried subclassing the Timer in the hope that the callback would get the subclass instance but this didn't ...
by v923z
Mon Jul 10, 2017 8:39 am
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2977

Re: retrieving timer ID

I don't know the answer to your question, but a workround could be achieved by creating a class which stores the timer ID along with the timer itself: class MyTimer(): def __init__(self, id): self.id = id self.timer = pyb.Timer(id) def timer_callback(my_timer): timer = my_timer.timer timer.deinit()...
by v923z
Sat Jul 08, 2017 6:39 pm
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2977

retrieving timer ID

Is there a way of finding out a timer's ID in its callback function? I need to initialise and deinitialise timers which are not tied to specific tasks. Basically, I have a bunch of methods that could require a single-shot timer, but not necessarily. Since I don't know in advance, whether a particula...
by v923z
Mon Feb 06, 2017 7:22 am
Forum: Development of MicroPython
Topic: hiding python code on the board
Replies: 21
Views: 6079

Re: hiding python code on the board

To make things a bit harder why not: 1) disable REPL (do not compile it into your FW) But that is the whole point. I would like to retain the REPL. Otherwise, I could just write the whole stuff in C on a microcontroller that is tamper-proof. PS: Why not make the *key* hidden and use a encryption al...
by v923z
Mon Feb 06, 2017 7:16 am
Forum: Development of MicroPython
Topic: hiding python code on the board
Replies: 21
Views: 6079

Re: hiding python code on the board

dhylands wrote:You can read out the code through the REPL.
Interesting. So, how would I do that? I mean, given the compiled C code for unscramble, what would I have to do on the python prompt to get the unscrambled code?
by v923z
Sun Feb 05, 2017 7:45 am
Forum: Development of MicroPython
Topic: hiding python code on the board
Replies: 21
Views: 6079

Re: hiding python code on the board

flash contains a bunch of stuff: 1 - The Micropython firmware - i.e. the compiled C 2 - The internal filesystem 3 - Any frozen bytecode that you've compiled into the firmware. Extracting the frozen bytecodes and internal filesystem is straight forward given a memory dump or debugger access, just us...
by v923z
Sat Feb 04, 2017 8:52 pm
Forum: Development of MicroPython
Topic: hiding python code on the board
Replies: 21
Views: 6079

Re: hiding python code on the board

You'd also want to modify the firmware to not execute any code from an external source, like an SD card. It's trivial to write a small python script which dumps the entire contents of flash and RAM to a file on the sdcard. Does it matter, where the code is executed from? Once you have the REPL, any...