parent
c58cc326dc
commit
c0c3280d12
8 changed files with 55 additions and 110 deletions
|
@ -12,9 +12,6 @@ const int gpio = 14;
|
|||
|
||||
/* This task uses the high level GPIO API (esp_gpio.h) to blink an LED.
|
||||
*
|
||||
* Even though it reads better than the register-level version in blinkenRegisterTask,
|
||||
* they compile to the exact same instructions (except gpio_enable also set the output type in
|
||||
* the GPIO control register).
|
||||
*/
|
||||
void blinkenTask(void *pvParameters)
|
||||
{
|
||||
|
@ -28,10 +25,12 @@ void blinkenTask(void *pvParameters)
|
|||
}
|
||||
|
||||
|
||||
/* This task uses all raw register operations to set the pins.
|
||||
/* This task demonstrates an alternative way to use raw register
|
||||
operations to blink an LED.
|
||||
|
||||
It's not fully parameterised, as the IOMUX_GPIO# macros involve a non-linear
|
||||
mapping from GPIO to IOMUX ports.
|
||||
The step that sets the iomux register can't be automatically
|
||||
updated from the 'gpio' constant variable, so you need to change
|
||||
the line that sets IOMUX_GPIO14 if you change 'gpio'.
|
||||
|
||||
There is no significant performance benefit to this way over the
|
||||
blinkenTask version, so it's probably better to use the blinkenTask
|
||||
|
|
|
@ -17,7 +17,7 @@ const char *dramtest = TESTSTRING;
|
|||
const __attribute__((section(".iram1.notrodata"))) char iramtest[] = TESTSTRING;
|
||||
const __attribute__((section(".text.notrodata"))) char iromtest[] = TESTSTRING;
|
||||
|
||||
INLINED uint32_t get_ccount (void)
|
||||
static inline uint32_t get_ccount (void)
|
||||
{
|
||||
uint32_t ccount;
|
||||
asm volatile ("rsr.ccount %0" : "=a" (ccount));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue