newAM / stm32wl-lightswitch-demo

Demo project for the stm32wlxx-hal
MIT License
7 stars 2 forks source link

Question about RTIC and interrupt setup #126

Closed huming2207 closed 2 months ago

huming2207 commented 2 months ago

Hi @newAM

Sorry this might be stupid question. I've got some time recently and I went back learning Rust on STM32WL again. Now I'm just curious how do you set up the interrupts with RTIC?

For example, in the init() routine in your client/src/main.rs, I haven't seen you calling NVIC's unmask() to enable the NVIC for LPTimer or SubGHZ peripherals. I've only seen you called the set_ier() for lptim1. Has RTIC itself done this implicitly when in init()?

Regards, Jackson

huming2207 commented 2 months ago

Okay I had a read in RTIC issues and I can understand now that I don't (and I shouldn't) touch NVIC stuff as RTIC has done that for me... I will just implement the code like yours without worrying about the NVIC stuff then.

newAM commented 2 months ago

You can expand macros (I forget how off the top of my head) to better see what RTIC does under the hood.

huming2207 commented 2 months ago

You can expand macros (I forget how off the top of my head) to better see what RTIC does under the hood.

Yea, I forgot that earlier too, I will have a look.