fsl_pint.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  4. * Copyright 2016-2017 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of the copyright holder nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #include "fsl_pint.h"
  35. /* Component ID definition, used by tools. */
  36. #ifndef FSL_COMPONENT_ID
  37. #define FSL_COMPONENT_ID "platform.drivers.pint"
  38. #endif
  39. /*******************************************************************************
  40. * Variables
  41. ******************************************************************************/
  42. /*! @brief Irq number array */
  43. static const IRQn_Type s_pintIRQ[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS] = PINT_IRQS;
  44. /*! @brief Callback function array for PINT(s). */
  45. static pint_cb_t s_pintCallback[FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS];
  46. /*******************************************************************************
  47. * Code
  48. ******************************************************************************/
  49. void PINT_Init(PINT_Type *base)
  50. {
  51. uint32_t i;
  52. uint32_t pmcfg;
  53. assert(base);
  54. pmcfg = 0;
  55. for (i = 0; i < FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++)
  56. {
  57. s_pintCallback[i] = NULL;
  58. }
  59. /* Disable all bit slices */
  60. for (i = 0; i < PINT_PIN_INT_COUNT; i++)
  61. {
  62. pmcfg = pmcfg | (kPINT_PatternMatchNever << (PININT_BITSLICE_CFG_START + (i * 3U)));
  63. }
  64. #if defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 1)
  65. /* Enable the peripheral clock */
  66. CLOCK_EnableClock(kCLOCK_GpioInt);
  67. /* Reset the peripheral */
  68. RESET_PeripheralReset(kGPIOINT_RST_N_SHIFT_RSTn);
  69. #elif defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 0)
  70. /* Enable the peripheral clock */
  71. CLOCK_EnableClock(kCLOCK_Gpio0);
  72. /* Reset the peripheral */
  73. RESET_PeripheralReset(kGPIO0_RST_N_SHIFT_RSTn);
  74. #else
  75. /* Enable the peripheral clock */
  76. CLOCK_EnableClock(kCLOCK_Pint);
  77. /* Reset the peripheral */
  78. RESET_PeripheralReset(kPINT_RST_SHIFT_RSTn);
  79. #endif /* FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE && FSL_FEATURE_CLOCK_HAS_NO_GPIOINT_CLOCK_SOURCE*/
  80. /* Disable all pattern match bit slices */
  81. base->PMCFG = pmcfg;
  82. }
  83. void PINT_PinInterruptConfig(PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback)
  84. {
  85. assert(base);
  86. /* Clear Rise and Fall flags first */
  87. PINT_PinInterruptClrRiseFlag(base, intr);
  88. PINT_PinInterruptClrFallFlag(base, intr);
  89. /* select level or edge sensitive */
  90. base->ISEL = (base->ISEL & ~(1U << intr)) | ((enable & PINT_PIN_INT_LEVEL) ? (1U << intr) : 0U);
  91. /* enable rising or level interrupt */
  92. if (enable & (PINT_PIN_INT_LEVEL | PINT_PIN_INT_RISE))
  93. {
  94. base->SIENR = 1U << intr;
  95. }
  96. else
  97. {
  98. base->CIENR = 1U << intr;
  99. }
  100. /* Enable falling or select high level */
  101. if (enable & PINT_PIN_INT_FALL_OR_HIGH_LEVEL)
  102. {
  103. base->SIENF = 1U << intr;
  104. }
  105. else
  106. {
  107. base->CIENF = 1U << intr;
  108. }
  109. s_pintCallback[intr] = callback;
  110. }
  111. void PINT_PinInterruptGetConfig(PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback)
  112. {
  113. uint32_t mask;
  114. bool level;
  115. assert(base);
  116. *enable = kPINT_PinIntEnableNone;
  117. level = false;
  118. mask = 1U << pintr;
  119. if (base->ISEL & mask)
  120. {
  121. /* Pin interrupt is level sensitive */
  122. level = true;
  123. }
  124. if (base->IENR & mask)
  125. {
  126. if (level)
  127. {
  128. /* Level interrupt is enabled */
  129. *enable = kPINT_PinIntEnableLowLevel;
  130. }
  131. else
  132. {
  133. /* Rising edge interrupt */
  134. *enable = kPINT_PinIntEnableRiseEdge;
  135. }
  136. }
  137. if (base->IENF & mask)
  138. {
  139. if (level)
  140. {
  141. /* Level interrupt is active high */
  142. *enable = kPINT_PinIntEnableHighLevel;
  143. }
  144. else
  145. {
  146. /* Either falling or both edge */
  147. if (*enable == kPINT_PinIntEnableRiseEdge)
  148. {
  149. /* Rising and faling edge */
  150. *enable = kPINT_PinIntEnableBothEdges;
  151. }
  152. else
  153. {
  154. /* Falling edge */
  155. *enable = kPINT_PinIntEnableFallEdge;
  156. }
  157. }
  158. }
  159. *callback = s_pintCallback[pintr];
  160. }
  161. void PINT_PatternMatchConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg)
  162. {
  163. uint32_t src_shift;
  164. uint32_t cfg_shift;
  165. uint32_t pmcfg;
  166. assert(base);
  167. src_shift = PININT_BITSLICE_SRC_START + (bslice * 3U);
  168. cfg_shift = PININT_BITSLICE_CFG_START + (bslice * 3U);
  169. /* Input source selection for selected bit slice */
  170. base->PMSRC = (base->PMSRC & ~(PININT_BITSLICE_SRC_MASK << src_shift)) | (cfg->bs_src << src_shift);
  171. /* Bit slice configuration */
  172. pmcfg = base->PMCFG;
  173. pmcfg = (pmcfg & ~(PININT_BITSLICE_CFG_MASK << cfg_shift)) | (cfg->bs_cfg << cfg_shift);
  174. /* If end point is true, enable the bits */
  175. if (bslice != 7U)
  176. {
  177. if (cfg->end_point)
  178. {
  179. pmcfg |= (0x1U << bslice);
  180. }
  181. else
  182. {
  183. pmcfg &= ~(0x1U << bslice);
  184. }
  185. }
  186. base->PMCFG = pmcfg;
  187. /* Save callback pointer */
  188. s_pintCallback[bslice] = cfg->callback;
  189. }
  190. void PINT_PatternMatchGetConfig(PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg)
  191. {
  192. uint32_t src_shift;
  193. uint32_t cfg_shift;
  194. assert(base);
  195. src_shift = PININT_BITSLICE_SRC_START + (bslice * 3U);
  196. cfg_shift = PININT_BITSLICE_CFG_START + (bslice * 3U);
  197. cfg->bs_src = (pint_pmatch_input_src_t)((base->PMSRC & (PININT_BITSLICE_SRC_MASK << src_shift)) >> src_shift);
  198. cfg->bs_cfg = (pint_pmatch_bslice_cfg_t)((base->PMCFG & (PININT_BITSLICE_CFG_MASK << cfg_shift)) >> cfg_shift);
  199. if (bslice == 7U)
  200. {
  201. cfg->end_point = true;
  202. }
  203. else
  204. {
  205. cfg->end_point = (base->PMCFG & (0x1U << bslice)) >> bslice;
  206. }
  207. cfg->callback = s_pintCallback[bslice];
  208. }
  209. uint32_t PINT_PatternMatchResetDetectLogic(PINT_Type *base)
  210. {
  211. uint32_t pmctrl;
  212. uint32_t pmstatus;
  213. uint32_t pmsrc;
  214. pmctrl = PINT->PMCTRL;
  215. pmstatus = pmctrl >> PINT_PMCTRL_PMAT_SHIFT;
  216. if (pmstatus)
  217. {
  218. /* Reset Pattern match engine detection logic */
  219. pmsrc = base->PMSRC;
  220. base->PMSRC = pmsrc;
  221. }
  222. return (pmstatus);
  223. }
  224. void PINT_EnableCallback(PINT_Type *base)
  225. {
  226. uint32_t i;
  227. assert(base);
  228. PINT_PinInterruptClrStatusAll(base);
  229. for (i = 0; i < FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++)
  230. {
  231. NVIC_ClearPendingIRQ(s_pintIRQ[i]);
  232. PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i);
  233. EnableIRQ(s_pintIRQ[i]);
  234. }
  235. }
  236. void PINT_DisableCallback(PINT_Type *base)
  237. {
  238. uint32_t i;
  239. assert(base);
  240. for (i = 0; i < FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++)
  241. {
  242. DisableIRQ(s_pintIRQ[i]);
  243. PINT_PinInterruptClrStatus(base, (pint_pin_int_t)i);
  244. NVIC_ClearPendingIRQ(s_pintIRQ[i]);
  245. }
  246. }
  247. void PINT_Deinit(PINT_Type *base)
  248. {
  249. uint32_t i;
  250. assert(base);
  251. /* Cleanup */
  252. PINT_DisableCallback(base);
  253. for (i = 0; i < FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS; i++)
  254. {
  255. s_pintCallback[i] = NULL;
  256. }
  257. #if defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 1)
  258. /* Reset the peripheral */
  259. RESET_PeripheralReset(kGPIOINT_RST_N_SHIFT_RSTn);
  260. /* Disable the peripheral clock */
  261. CLOCK_DisableClock(kCLOCK_GpioInt);
  262. #elif defined(FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE) && (FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE == 0)
  263. /* Reset the peripheral */
  264. RESET_PeripheralReset(kGPIO0_RST_N_SHIFT_RSTn);
  265. /* Disable the peripheral clock */
  266. CLOCK_DisableClock(kCLOCK_Gpio0);
  267. #else
  268. /* Reset the peripheral */
  269. RESET_PeripheralReset(kPINT_RST_SHIFT_RSTn);
  270. /* Disable the peripheral clock */
  271. CLOCK_DisableClock(kCLOCK_Pint);
  272. #endif /* FSL_FEATURE_CLOCK_HAS_GPIOINT_CLOCK_SOURCE */
  273. }
  274. /* IRQ handler functions overloading weak symbols in the startup */
  275. void PIN_INT0_DriverIRQHandler(void)
  276. {
  277. uint32_t pmstatus;
  278. /* Reset pattern match detection */
  279. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  280. /* Call user function */
  281. if (s_pintCallback[kPINT_PinInt0] != NULL)
  282. {
  283. s_pintCallback[kPINT_PinInt0](kPINT_PinInt0, pmstatus);
  284. }
  285. if((PINT->ISEL & 0x1U) == 0x0U)
  286. {
  287. /* Edge sensitive: clear Pin interrupt after callback */
  288. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt0);
  289. }
  290. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  291. exception return operation might vector to incorrect interrupt */
  292. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  293. __DSB();
  294. #endif
  295. }
  296. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 1U)
  297. void PIN_INT1_DriverIRQHandler(void)
  298. {
  299. uint32_t pmstatus;
  300. /* Reset pattern match detection */
  301. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  302. /* Call user function */
  303. if (s_pintCallback[kPINT_PinInt1] != NULL)
  304. {
  305. s_pintCallback[kPINT_PinInt1](kPINT_PinInt1, pmstatus);
  306. }
  307. if((PINT->ISEL & 0x2U) == 0x0U)
  308. {
  309. /* Edge sensitive: clear Pin interrupt after callback */
  310. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt1);
  311. }
  312. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  313. exception return operation might vector to incorrect interrupt */
  314. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  315. __DSB();
  316. #endif
  317. }
  318. #endif
  319. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 2U)
  320. void PIN_INT2_DriverIRQHandler(void)
  321. {
  322. uint32_t pmstatus;
  323. /* Reset pattern match detection */
  324. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  325. /* Call user function */
  326. if (s_pintCallback[kPINT_PinInt2] != NULL)
  327. {
  328. s_pintCallback[kPINT_PinInt2](kPINT_PinInt2, pmstatus);
  329. }
  330. if((PINT->ISEL & 0x4U) == 0x0U)
  331. {
  332. /* Edge sensitive: clear Pin interrupt after callback */
  333. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt2);
  334. }
  335. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  336. exception return operation might vector to incorrect interrupt */
  337. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  338. __DSB();
  339. #endif
  340. }
  341. #endif
  342. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 3U)
  343. void PIN_INT3_DriverIRQHandler(void)
  344. {
  345. uint32_t pmstatus;
  346. /* Reset pattern match detection */
  347. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  348. /* Call user function */
  349. if (s_pintCallback[kPINT_PinInt3] != NULL)
  350. {
  351. s_pintCallback[kPINT_PinInt3](kPINT_PinInt3, pmstatus);
  352. }
  353. if((PINT->ISEL & 0x8U) == 0x0U)
  354. {
  355. /* Edge sensitive: clear Pin interrupt after callback */
  356. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt3);
  357. }
  358. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  359. exception return operation might vector to incorrect interrupt */
  360. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  361. __DSB();
  362. #endif
  363. }
  364. #endif
  365. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4U)
  366. void PIN_INT4_DriverIRQHandler(void)
  367. {
  368. uint32_t pmstatus;
  369. /* Reset pattern match detection */
  370. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  371. /* Call user function */
  372. if (s_pintCallback[kPINT_PinInt4] != NULL)
  373. {
  374. s_pintCallback[kPINT_PinInt4](kPINT_PinInt4, pmstatus);
  375. }
  376. if((PINT->ISEL & 0x10U) == 0x0U)
  377. {
  378. /* Edge sensitive: clear Pin interrupt after callback */
  379. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt4);
  380. }
  381. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  382. exception return operation might vector to incorrect interrupt */
  383. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  384. __DSB();
  385. #endif
  386. }
  387. #endif
  388. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 5U)
  389. #if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER
  390. void PIN_INT5_DAC1_IRQHandler(void)
  391. #else
  392. void PIN_INT5_DriverIRQHandler(void)
  393. #endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */
  394. {
  395. uint32_t pmstatus;
  396. /* Reset pattern match detection */
  397. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  398. /* Call user function */
  399. if (s_pintCallback[kPINT_PinInt5] != NULL)
  400. {
  401. s_pintCallback[kPINT_PinInt5](kPINT_PinInt5, pmstatus);
  402. }
  403. if((PINT->ISEL & 0x20U) == 0x0U)
  404. {
  405. /* Edge sensitive: clear Pin interrupt after callback */
  406. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt5);
  407. }
  408. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  409. exception return operation might vector to incorrect interrupt */
  410. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  411. __DSB();
  412. #endif
  413. }
  414. #endif
  415. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 6U)
  416. #if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER
  417. void PIN_INT6_USART3_IRQHandler(void)
  418. #else
  419. void PIN_INT6_DriverIRQHandler(void)
  420. #endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */
  421. {
  422. uint32_t pmstatus;
  423. /* Reset pattern match detection */
  424. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  425. /* Call user function */
  426. if (s_pintCallback[kPINT_PinInt6] != NULL)
  427. {
  428. s_pintCallback[kPINT_PinInt6](kPINT_PinInt6, pmstatus);
  429. }
  430. if((PINT->ISEL & 0x40U) == 0x0U)
  431. {
  432. /* Edge sensitive: clear Pin interrupt after callback */
  433. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt6);
  434. }
  435. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  436. exception return operation might vector to incorrect interrupt */
  437. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  438. __DSB();
  439. #endif
  440. }
  441. #endif
  442. #if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 7U)
  443. #if defined(FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER) && FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER
  444. void PIN_INT7_USART4_IRQHandler(void)
  445. #else
  446. void PIN_INT7_DriverIRQHandler(void)
  447. #endif /* FSL_FEATURE_NVIC_HAS_SHARED_INTERTTUPT_NUMBER */
  448. {
  449. uint32_t pmstatus;
  450. /* Reset pattern match detection */
  451. pmstatus = PINT_PatternMatchResetDetectLogic(PINT);
  452. /* Call user function */
  453. if (s_pintCallback[kPINT_PinInt7] != NULL)
  454. {
  455. s_pintCallback[kPINT_PinInt7](kPINT_PinInt7, pmstatus);
  456. }
  457. if((PINT->ISEL & 0x80U) == 0x0U)
  458. {
  459. /* Edge sensitive: clear Pin interrupt after callback */
  460. PINT_PinInterruptClrStatus(PINT, kPINT_PinInt7);
  461. }
  462. /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  463. exception return operation might vector to incorrect interrupt */
  464. #if defined __CORTEX_M && (__CORTEX_M == 4U)
  465. __DSB();
  466. #endif
  467. }
  468. #endif