![]() POKE32(XOSC_CTRL, XOSC_CTRL_FREQ_RANGE_VALUE_1_15MHZ I will try your suggestion and let you know if it worked.Ĭode: Select all //. Why should it be executed any slower? I see your solution as applicable in a situation where large bits of code are in Flash but certain time critical functions should be moved to RAM for faster execution. Like I have mentioned above, the entire code is placed in SRAM at Addresses starting at 0x2001_0000. Then you can just "blinkpin(2)" and your done! "b 1b" branches backwards to the first "1:" it encounters, which is the label for the str, so it repeats infinitely "nop" just adds a delay, add/remove nop's to tune it some "str %0," will then write the pin mask to that register, and gcc will replace %0 and %1 with whatever registers it picked The inline asm then has 2 arguments, "1gpio_togl" to get the address of the gpio toggle register _attribute_((noinline)) ensures the compiler wont inline it, so it does actually call the copy in ram The _scratch_x("blinkpin") part tells the build system to place this funtion in ram automatically
0 Comments
Leave a Reply. |