Skip to Content
Hands-On Embedded Programming with C++17
book

Hands-On Embedded Programming with C++17

by Maya Posch
January 2019
Intermediate to advanced
458 pages
10h 35m
English
Packt Publishing
Content preview from Hands-On Embedded Programming with C++17

Interrupts, ESP8266 IRAM_ATTR

On a desktop PC or server the entire application binary would be loaded into RAM. On MCUs though it is common to leave as many of the program instructions in the ROM as possible until they are needed. This means that most of our application's instructions cannot be executed immediately, but first have to be fetched from ROM before the CPU of our MCU can fetch them via the instruction bus to be executed.

On the AVR, each possible interrupt is defined in a vector table, which is stored in ROM. This offers either default handlers for each interrupt type, or the user-defined version. To mark an interrupt routine, one either uses the __attribute__((signal)) attribute, or uses the ISR() macro:

#include <avr/interrupt.h> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers

Hands-On RTOS with Microcontrollers

Brian Amos

Publisher Resources

ISBN: 9781788629300Supplemental Content