Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嵌入式系统中的“中断上下文保存”是什么?我在我不熟悉的 IDE 中配置中断处理程序。在配置设置中,它为我提供了不保存上下文或“自动”的选项(编译器选择是否执行上下文保存)。我应该选择哪个,为什么?
自动上下文保存意味着设备将根据中断请求将基本寄存器(在 PIC > W、STATUS、BSR、FSR、PCLATH 等中)保存到影子寄存器。
当从中断程序返回时,这些寄存器会自动恢复到它们在 ISR 之前的值。
使用它取决于您的固件。