I found the below setup function from some forum code while trying to understand Timer1.
I was curious as to why the author use the "interrupts()" & "noInterrupts()" in the setup function.
I would have thought interrupts were disabled on bootup.
Regardless of where it's done, if you're tinkering with the settings of timers and other hardware devices, it is sometimes wise, even necessary, to disable interrupts just to ensure things get initialized properly, and interrupts do not occur until you are prepared to handle them.
Thank you. It's been along time since I used C without the "help" of the Arduino IDE macro's. When I first started with the Arduino (from Microchip) I stubbornly forced myself to do it the "old" way. Then when I was rushing to see how a sensor worked I slipped down the slope and become defendant on the IDE Macro's. Kinka like opioids
Oh and I'm not a programmer I'm mostly a hardware engineer. I'm sure that explains a lot