rtos

Polling or Interrupt based method

荒凉一梦 提交于 2019-11-27 09:25:17
问题 When should one use polling method and when should one use interrupt based method ? Are there scenarios in which both can be used ? 回答1: If the event of interest is: Asynchronous Urgent Infrequent then an interrupt based handler would make sense. If the event of interest is: Synchronous (i.e. you know when to expect it within a small window) Not Urgent (i.e. a slow polling interval has no ill effects) Frequent (i.e. majority of your polling cycles create a 'hit') then polling might be a