]> granicus.if.org Git - esp-idf/commit
Bugfix I_DELAY macro
authorrobotrovsky <robotrovsky@users.noreply.github.com>
Thu, 23 Nov 2017 19:51:17 +0000 (20:51 +0100)
committerAngus Gratton <gus@projectgus.com>
Wed, 6 Dec 2017 23:02:45 +0000 (10:02 +1100)
commit6a51a13b70b12df39439c788cb8e9a96baebd8fd
tree7ac441754e9934bfad5887d6ae0028a4513b0de3
parentdceda4ab39ce0ac44d226398d6e627ecba47d13d
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
components/ulp/include/esp32/ulp.h