Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new interrupt allocator #2

Closed
MartyMacGyver opened this issue Feb 15, 2017 · 1 comment
Closed

Use new interrupt allocator #2

MartyMacGyver opened this issue Feb 15, 2017 · 1 comment

Comments

@MartyMacGyver
Copy link
Owner

MartyMacGyver commented Feb 15, 2017

As recommended in this discussion:

Migrate to the new interrupt allocator:

@MartyMacGyver
Copy link
Owner Author

intr_matrix_set(xPortGetCoreID(), ETS_RMT_INTR_SOURCE, ETS_RMT_CTRL_INUM);
ESP_RMT_CTRL_INTRL(ws2812_handleInterrupt, NULL);
...
ESP_INTR_ENABLE(ETS_RMT_CTRL_INUM);

after macro expansion becomes

intr_matrix_set(xPortGetCoreID(), ETS_RMT_INTR_SOURCE, ETS_RMT_CTRL_INUM);
xt_set_interrupt_handler(ETS_RMT_CTRL_INUM, ws2812_handleInterrupt, NULL)
...
xt_ints_on(1<<ETS_RMT_CTRL_INUM)

tweaked with BIT macro becomes

intr_matrix_set(xPortGetCoreID(), ETS_RMT_INTR_SOURCE, ETS_RMT_CTRL_INUM);
xt_set_interrupt_handler(ETS_RMT_CTRL_INUM, ws2812_handleInterrupt, NULL)
...
#define BIT(x) (1 << (x))
xt_ints_on(BIT(ETS_RMT_CTRL_INUM))

in new interrupt scheme should become:

esp_intr_alloc(ETS_RMT_INTR_SOURCE, 0, ws2812_handleInterrupt, NULL, rmt_intr_handle);
  • xPortGetCoreID() should be superfluous - per docs: "The interrupt will always be allocated on the core that runs this function"
  • This allocates AND enables the interrupt.
  • Not sure how ETS_RMT_CTRL_INUM goes away here but it appears to.

esp_intr_enable()/esp_intr_enable() on intr_handle_t *rmt_intr_handle should work (or set that param to NULL if always on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant