mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
Bugfix I_DELAY macro
When compiling > const ulp_insn_t program[] = { > I_DELAY(1) > }; with the xtensa-esp32-elf-g++ compiler i always got the error: > sorry, unimplemented: non-trivial designated initializers not supported > > }; This was due to the different order in the macro and the struct. The struct has another order of the fields (opcode, unused, cycles) vs (cycles, unused, opcode): > struct { > uint32_t cycles : 16; /*!< Number of cycles to sleep */ > uint32_t unused : 12; /*!< Unused */ > uint32_t opcode : 4; /*!< Opcode (OPCODE_DELAY) */ > } delay; /*!< Format of DELAY instruction */ After updating the order in the macro it is possible to compile with the g++ compiler. Merges https://github.com/espressif/esp-idf/pull/1310
This commit is contained in:
committed by
Angus Gratton
parent
dceda4ab39
commit
6a51a13b70
@@ -266,9 +266,9 @@ _Static_assert(sizeof(ulp_insn_t) == 4, "ULP coprocessor instruction size should
|
|||||||
* Delay (nop) for a given number of cycles
|
* Delay (nop) for a given number of cycles
|
||||||
*/
|
*/
|
||||||
#define I_DELAY(cycles_) { .delay = {\
|
#define I_DELAY(cycles_) { .delay = {\
|
||||||
.opcode = OPCODE_DELAY, \
|
.cycles = cycles_, \
|
||||||
.unused = 0, \
|
.unused = 0, \
|
||||||
.cycles = cycles_ } }
|
.opcode = OPCODE_DELAY } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Halt the coprocessor.
|
* Halt the coprocessor.
|
||||||
|
Reference in New Issue
Block a user