Andes Workshop http://forum.andestech.com/ |
|
如何使得程式碼不被interrupt中斷? http://forum.andestech.com/viewtopic.php?f=25&t=675 |
Page 1 of 1 |
Author: | cindy [ Fri Feb 22, 2013 12:07 pm ] |
Post subject: | 如何使得程式碼不被interrupt中斷? |
在programming時, 需要保護一段code,使得它不被中斷打斷(岔斷), 該怎麼做呢? 在C語言裡,並沒有避免中斷的語法, 中斷是硬體的行為。 要保護code不被中斷打擾,最簡單的方法是把GIE關掉。 等到這幾行code執行完之後,再把GIE打開。 (用mask把中斷關掉亦可) |
Page 1 of 1 | All times are UTC + 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |