Quantcast
Viewing all articles
Browse latest Browse all 5391

SDK • Re: troubletrouble defining a macro to replace a zero argument fn call: micros()

One can cover the BS, but it still stinks. Image may be NSFW.
Clik here to view.
:)


"#undef micros" would do nothing meaningful if it's not used in the original sources, because micros() is a function (dealt by compiler), not a preprocessor definition.

If you want to replace that function, you have to rewrite it (with or without 'inline').
'Inline' is just an optimization for speed (at a cost of size).

Or just use a text editor and use the magic Find&Replace ... or a fancy code refactoring in a useful IDE (that means not Arduino IDE).

P.S. You made me dig into BS ... again.
I've put a Arduino test in a proper debugger and it looks like those function have been already replaced (in arduino-pico) by:

Code:

  delay() for the Raspberry Pi Pico RP2040    Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>  ...    uint32_t millis() {        return to_ms_since_boot(get_absolute_time());    }    uint32_t micros() {        return to_us_since_boot(get_absolute_time());    }
And there are no macro conditional definitions.
I've tried to use the undef, it does absolutely nothing, as expected.

Statistics: Posted by gmx — Sat Oct 05, 2024 2:30 am



Viewing all articles
Browse latest Browse all 5391

Trending Articles