{"id":350,"date":"2014-01-03T15:34:54","date_gmt":"2014-01-03T15:34:54","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=350"},"modified":"2022-02-18T15:37:49","modified_gmt":"2022-02-18T15:37:49","slug":"example-irq-handler","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic18\/xc8-compiler\/interrupts\/example-irq-handler","title":{"rendered":"Example IRQ Handler"},"content":{"rendered":"<p>\n&nbsp;\n<\/p>\n<pre>\r\n<code>\r\n\r\n\/\/************************************************\r\n\/\/************************************************\r\n\/\/********** INTERRUPT SERVICE ROUTINES **********\r\n\/\/************************************************\r\n\/\/************************************************\r\n\r\n\/\/**********************************************\r\n\/\/**********************************************\r\n\/\/********** HIGH PRIORITY INTERRUPTS **********\r\n\/\/**********************************************\r\n\/\/**********************************************\r\nvoid interrupt my_high_priority_irq_handler(void)\r\n{\r\n\t\/\/if (TMR0IE &amp;&amp; TMR0IF)\r\n\t\/\/{\r\n\t\/\/    TMR0IF=0;\r\n\r\n\t\/\/    return;\r\n\t\/\/}\r\n\r\n\t\/\/ process other interrupt sources here, if required\r\n}\r\n\r\n\r\n\/\/*********************************************\r\n\/\/*********************************************\r\n\/\/********** LOW PRIORITY INTERRUPTS **********\r\n\/\/*********************************************\r\n\/\/*********************************************\r\nvoid interrupt low_priority my_low_priority_irq_handler(void)\r\n{\r\n    \/\/if (TMR1IE &amp;&amp; TMR1IF)\r\n\t\/\/{\r\n\t\/\/\tTMR1IF=0;\r\n        \r\n\t\/\/\treturn;\r\n\t\/\/}\r\n\r\n    \/\/ process any other low priority sources here\r\n}\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \/\/************************************************ \/\/************************************************ \/\/********** INTERRUPT SERVICE ROUTINES ********** \/\/************************************************ \/\/************************************************ \/\/********************************************** \/\/********************************************** \/\/********** HIGH PRIORITY INTERRUPTS ********** \/\/********************************************** \/\/********************************************** void interrupt my_high_priority_irq_handler(void) { \/\/if (TMR0IE &amp;&amp; TMR0IF) \/\/{ \/\/ TMR0IF=0; \/\/ return; \/\/} \/\/ process other interrupt sources here, if required } \/\/********************************************* \/\/********************************************* \/\/********** LOW PRIORITY INTERRUPTS ********** \/\/********************************************* \/\/********************************************* void interrupt low_priority my_low_priority_irq_handler(void) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-interrupts"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/350\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}