2 * -------------------------------------------
3 * MSP432 DriverLib - v01_04_00_18
4 * -------------------------------------------
6 * --COPYRIGHT--,BSD,BSD
7 * Copyright (c) 2015, Texas Instruments Incorporated
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
21 * * Neither the name of Texas Instruments Incorporated nor the names of
22 * its contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 /* Standard Includes */
40 /* DriverLib Includes */
43 #include <interrupt.h>
50 static const uint32_t MAX_PROGRAM_TRIES = 5;
51 static const uint32_t MAX_ERASE_TRIES = 50;
53 static uint32_t getUserFlashSector(uint32_t addr)
57 addr = addr - 0x20000;
83 return FLASH_SECTOR10;
85 return FLASH_SECTOR11;
87 return FLASH_SECTOR12;
89 return FLASH_SECTOR13;
91 return FLASH_SECTOR14;
93 return FLASH_SECTOR15;
95 return FLASH_SECTOR16;
97 return FLASH_SECTOR17;
99 return FLASH_SECTOR18;
101 return FLASH_SECTOR19;
103 return FLASH_SECTOR20;
105 return FLASH_SECTOR21;
107 return FLASH_SECTOR22;
109 return FLASH_SECTOR23;
111 return FLASH_SECTOR24;
113 return FLASH_SECTOR25;
115 return FLASH_SECTOR26;
117 return FLASH_SECTOR27;
119 return FLASH_SECTOR28;
121 return FLASH_SECTOR29;
123 return FLASH_SECTOR30;
125 return FLASH_SECTOR31;
132 static bool _FlashCtl_Program8(uint32_t src, uint32_t dest)
136 /* Enabling the correct verification settings */
137 FlashCtl_setProgramVerification(FLASH_REGPRE | FLASH_REGPOST);
138 FlashCtl_clearProgramVerification(FLASH_BURSTPOST | FLASH_BURSTPRE);
140 for(ii=0;ii<MAX_PROGRAM_TRIES;ii++)
143 FLCTL->rCLRIFG.r |= (FLASH_PROGRAM_ERROR | FLASH_POSTVERIFY_FAILED
144 | FLASH_PREVERIFY_FAILED | FLASH_WRDPRGM_COMPLETE);
146 HWREG8(dest) = HWREG8(src);
148 while (!(FlashCtl_getInterruptStatus() & FLASH_WRDPRGM_COMPLETE))
153 if ((BITBAND_PERI(FLCTL->rIFG.r, FLCTL_IFG_PRG_ERR_OFS))
154 || (BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r,
155 FLCTL_PRG_CTLSTAT_VER_PRE_OFS)
156 && BITBAND_PERI(FLCTL->rIFG.r,
157 FLCTL_IFG_AVPRE_OFS))
158 || (BITBAND_PERI(FLCTL->rIFG.r, FLCTL_IFG_AVPST_OFS)))
160 if(BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_VER_PRE_OFS))
162 FlashCtl_clearProgramVerification(FLASH_REGPRE);
175 static bool _FlashCtl_Program32(uint32_t src, uint32_t dest)
179 /* Enabling the correct verification settings */
180 FlashCtl_setProgramVerification(FLASH_REGPRE | FLASH_REGPOST);
181 FlashCtl_clearProgramVerification(FLASH_BURSTPOST | FLASH_BURSTPRE);
183 for(ii=0;ii<MAX_PROGRAM_TRIES;ii++)
186 FLCTL->rCLRIFG.r |= (FLASH_PROGRAM_ERROR | FLASH_POSTVERIFY_FAILED
187 | FLASH_PREVERIFY_FAILED | FLASH_WRDPRGM_COMPLETE);
189 HWREG32(dest) = HWREG32(src);
191 while (!(FlashCtl_getInterruptStatus() & FLASH_WRDPRGM_COMPLETE))
196 if ((BITBAND_PERI(FLCTL->rIFG.r, FLCTL_IFG_PRG_ERR_OFS))
197 || (BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r,
198 FLCTL_PRG_CTLSTAT_VER_PRE_OFS)
199 && BITBAND_PERI(FLCTL->rIFG.r,
200 FLCTL_IFG_AVPRE_OFS))
201 || (BITBAND_PERI(FLCTL->rIFG.r, FLCTL_IFG_AVPST_OFS)))
203 if(BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_VER_PRE_OFS))
205 FlashCtl_clearProgramVerification(FLASH_REGPRE);
218 void FlashCtl_enableReadBuffering(uint_fast8_t memoryBank,
219 uint_fast8_t accessMethod)
221 if (memoryBank == FLASH_BANK0 && accessMethod == FLASH_DATA_READ)
222 BITBAND_PERI(FLCTL->rBANK0_RDCTL.r, FLCTL_BANK0_RDCTL_BUFD_OFS) = 1;
223 else if (memoryBank == FLASH_BANK1 && accessMethod == FLASH_DATA_READ)
224 BITBAND_PERI(FLCTL->rBANK1_RDCTL.r, FLCTL_BANK1_RDCTL_BUFD_OFS) = 1;
225 else if (memoryBank == FLASH_BANK0
226 && accessMethod == FLASH_INSTRUCTION_FETCH)
227 BITBAND_PERI(FLCTL->rBANK0_RDCTL.r, FLCTL_BANK0_RDCTL_BUFI_OFS) = 1;
228 else if (memoryBank == FLASH_BANK1
229 && accessMethod == FLASH_INSTRUCTION_FETCH)
230 BITBAND_PERI(FLCTL->rBANK1_RDCTL.r, FLCTL_BANK1_RDCTL_BUFI_OFS) = 1;
235 void FlashCtl_disableReadBuffering(uint_fast8_t memoryBank,
236 uint_fast8_t accessMethod)
238 if (memoryBank == FLASH_BANK0 && accessMethod == FLASH_DATA_READ)
239 BITBAND_PERI(FLCTL->rBANK0_RDCTL.r, FLCTL_BANK0_RDCTL_BUFD_OFS) = 0;
240 else if (memoryBank == FLASH_BANK1 && accessMethod == FLASH_DATA_READ)
241 BITBAND_PERI(FLCTL->rBANK1_RDCTL.r, FLCTL_BANK1_RDCTL_BUFD_OFS) = 0;
242 else if (memoryBank == FLASH_BANK0
243 && accessMethod == FLASH_INSTRUCTION_FETCH)
244 BITBAND_PERI(FLCTL->rBANK0_RDCTL.r, FLCTL_BANK0_RDCTL_BUFI_OFS) = 0;
245 else if (memoryBank == FLASH_BANK1
246 && accessMethod == FLASH_INSTRUCTION_FETCH)
247 BITBAND_PERI(FLCTL->rBANK1_RDCTL.r, FLCTL_BANK1_RDCTL_BUFI_OFS) = 0;
252 bool FlashCtl_unprotectSector(uint_fast8_t memorySpace, uint32_t sectorMask)
256 case FLASH_MAIN_MEMORY_SPACE_BANK0:
257 FLCTL->rBANK0_MAIN_WEPROT.r &= ~sectorMask;
259 case FLASH_MAIN_MEMORY_SPACE_BANK1:
260 FLCTL->rBANK1_MAIN_WEPROT.r &= ~sectorMask;
262 case FLASH_INFO_MEMORY_SPACE_BANK0:
263 ASSERT(sectorMask <= 0x04);
264 FLCTL->rBANK0_INFO_WEPROT.r &= ~sectorMask;
266 case FLASH_INFO_MEMORY_SPACE_BANK1:
267 ASSERT(sectorMask <= 0x04);
268 FLCTL->rBANK1_INFO_WEPROT.r &= ~sectorMask;
276 return !FlashCtl_isSectorProtected(memorySpace, sectorMask);
279 bool FlashCtl_protectSector(uint_fast8_t memorySpace, uint32_t sectorMask)
283 case FLASH_MAIN_MEMORY_SPACE_BANK0:
284 FLCTL->rBANK0_MAIN_WEPROT.r |= sectorMask;
286 case FLASH_MAIN_MEMORY_SPACE_BANK1:
287 FLCTL->rBANK1_MAIN_WEPROT.r |= sectorMask;
289 case FLASH_INFO_MEMORY_SPACE_BANK0:
290 ASSERT(sectorMask <= 0x04);
291 FLCTL->rBANK0_INFO_WEPROT.r |= sectorMask;
293 case FLASH_INFO_MEMORY_SPACE_BANK1:
294 ASSERT(sectorMask <= 0x04);
295 FLCTL->rBANK1_INFO_WEPROT.r |= sectorMask;
303 return FlashCtl_isSectorProtected(memorySpace, sectorMask);
306 bool FlashCtl_isSectorProtected(uint_fast8_t memorySpace, uint32_t sector)
310 case FLASH_MAIN_MEMORY_SPACE_BANK0:
311 return FLCTL->rBANK0_MAIN_WEPROT.r & sector;
312 case FLASH_MAIN_MEMORY_SPACE_BANK1:
313 return FLCTL->rBANK1_MAIN_WEPROT.r & sector;
314 case FLASH_INFO_MEMORY_SPACE_BANK0:
315 ASSERT(sector <= 0x04);
316 return FLCTL->rBANK0_INFO_WEPROT.r & sector;
317 case FLASH_INFO_MEMORY_SPACE_BANK1:
318 ASSERT(sector <= 0x04);
319 return FLCTL->rBANK1_INFO_WEPROT.r & sector;
325 bool FlashCtl_verifyMemory(void* verifyAddr, uint32_t length,
326 uint_fast8_t pattern)
328 uint32_t memoryPattern, addr, otpOffset;
329 uint_fast8_t memoryType;
331 ASSERT(pattern == FLASH_0_PATTERN || pattern == FLASH_1_PATTERN);
333 addr = (uint32_t) verifyAddr;
334 memoryPattern = (pattern == FLASH_1_PATTERN) ? 0xFFFFFFFF : 0;
335 memoryType = (addr > __MAIN_MEMORY_END__) ? FLASH_INFO_SPACE : FLASH_MAIN_SPACE;
337 /* Taking care of byte accesses */
338 while ((addr & 0x03) && (length > 0))
340 if (HWREG8(addr++) != ((uint8_t) memoryPattern))
345 /* Making sure we are aligned by 128-bit address */
346 while (((addr & 0x0F)) && (length > 3))
348 if (HWREG32(addr) != memoryPattern)
359 /* Setting/clearing INFO flash flags as appropriate */
360 if (addr > __MAIN_MEMORY_END__)
362 FLCTL->rRDBRST_CTLSTAT.r = (FLCTL->rRDBRST_CTLSTAT.r
363 & ~FLCTL_RDBRST_CTLSTAT_MEM_TYPE_M)
364 | FLCTL_RDBRST_CTLSTAT_MEM_TYPE_1;
365 otpOffset = 0x00200000;
368 FLCTL->rRDBRST_CTLSTAT.r = (FLCTL->rRDBRST_CTLSTAT.r
369 & ~FLCTL_RDBRST_CTLSTAT_MEM_TYPE_M)
370 | FLCTL_RDBRST_CTLSTAT_MEM_TYPE_0;
371 otpOffset = __MAIN_MEMORY_START__;
374 /* Clearing any lingering fault flags and preparing burst verify*/
375 BITBAND_PERI(FLCTL->rRDBRST_CTLSTAT.r, FLCTL_RDBRST_CTLSTAT_CLR_STAT_OFS) =
377 FLCTL->rRDBRST_FAILCNT.r = 0;
378 FLCTL->rRDBRST_STARTADDR.r = addr - otpOffset;
379 FLCTL->rRDBRST_LEN.r = (length & 0xFFFFFFF0);
380 addr += FLCTL->rRDBRST_LEN.r;
381 length = length & 0xF;
383 /* Starting Burst Verify */
384 FLCTL->rRDBRST_CTLSTAT.r = (FLCTL_RDBRST_CTLSTAT_STOP_FAIL | pattern
385 | memoryType | FLCTL_RDBRST_CTLSTAT_START);
387 /* While the burst read hasn't finished */
388 while ((FLCTL->rRDBRST_CTLSTAT.r & FLCTL_RDBRST_CTLSTAT_BRST_STAT_M)
389 != FLCTL_RDBRST_CTLSTAT_BRST_STAT_3)
394 /* Checking for a verification/access error/failure */
395 if (BITBAND_PERI(FLCTL->rRDBRST_CTLSTAT.r,
396 FLCTL_RDBRST_CTLSTAT_CMP_ERR_OFS)
397 || BITBAND_PERI(FLCTL->rRDBRST_CTLSTAT.r,
398 FLCTL_RDBRST_CTLSTAT_ADDR_ERR_OFS)
399 || FLCTL->rRDBRST_FAILCNT.r)
401 /* Clearing the Read Burst flag and returning */
402 BITBAND_PERI(FLCTL->rRDBRST_CTLSTAT.r, FLCTL_RDBRST_CTLSTAT_CLR_STAT_OFS) =
407 /* Clearing the Read Burst flag */
408 BITBAND_PERI(FLCTL->rRDBRST_CTLSTAT.r, FLCTL_RDBRST_CTLSTAT_CLR_STAT_OFS) =
413 /* Remaining Words */
416 if (HWREG32(addr) != memoryPattern)
423 /* Remaining Bytes */
426 if (HWREG8(addr++) != ((uint8_t) memoryPattern))
434 bool FlashCtl_setReadMode(uint32_t flashBank, uint32_t readMode)
437 if (FLCTL->rPOWER_STAT.r & FLCTL_POWER_STAT_RD_2T)
440 if (flashBank == FLASH_BANK0)
442 FLCTL->rBANK0_RDCTL.r = (FLCTL->rBANK0_RDCTL.r
443 & ~FLCTL_BANK0_RDCTL_RD_MODE_M) | readMode;
444 while (FLCTL->rBANK0_RDCTL.b.bRD_MODE != readMode)
446 } else if (flashBank == FLASH_BANK1)
448 FLCTL->rBANK1_RDCTL.r = (FLCTL->rBANK1_RDCTL.r
449 & ~FLCTL_BANK1_RDCTL_RD_MODE_M) | readMode;
450 while (FLCTL->rBANK1_RDCTL.b.bRD_MODE != readMode)
461 uint32_t FlashCtl_getReadMode(uint32_t flashBank)
463 if (flashBank == FLASH_BANK0)
465 return FLCTL->rBANK0_RDCTL.b.bRD_MODE;
466 } else if (flashBank == FLASH_BANK1)
468 return FLCTL->rBANK1_RDCTL.b.bRD_MODE;
476 bool FlashCtl_performMassErase(void)
478 uint32_t userFlash, ii, jj, sector;
480 /* Trying a mass erase in ROM first. If it fails (should be rare), going
481 * through and erasing each sector one-by-one
483 if (!FlashInternal_performMassErase(true))
485 userFlash = SysCtl_getFlashSize() / 2;
487 for (ii = __MAIN_MEMORY_START__; ii < userFlash; ii += 4096)
489 sector = getUserFlashSector(ii);
491 if (!((FLCTL->rBANK0_MAIN_WEPROT.r) & sector))
493 for (jj = 1; jj < MAX_ERASE_TRIES; jj++)
495 if (FlashInternal_eraseSector(ii, true))
501 if (jj == MAX_ERASE_TRIES)
505 if (!(FLCTL->rBANK1_MAIN_WEPROT.r & sector))
507 for (jj = 1; jj < MAX_ERASE_TRIES; jj++)
509 if (FlashInternal_eraseSector(ii + userFlash, true))
515 if (jj == MAX_ERASE_TRIES)
519 if (sector < FLCTL_BANK0_MAIN_WEPROT_PROT2)
521 if (!(FLCTL->rBANK0_INFO_WEPROT.r & sector))
523 for (jj = 1; jj < MAX_ERASE_TRIES; jj++)
525 if (FlashInternal_eraseSector(ii + __BSL_MEMORY_START__,
532 if (jj == MAX_ERASE_TRIES)
536 if (!(FLCTL->rBANK1_INFO_WEPROT.r & sector))
539 for (jj = 1; jj < MAX_ERASE_TRIES; jj++)
542 if (FlashInternal_eraseSector(
543 ii + __BSL_MEMORY_START__ + 0x2000, true))
549 if (jj == MAX_ERASE_TRIES)
560 bool FlashCtl_eraseSector(uint32_t addr)
564 for(ii=0;ii<MAX_ERASE_TRIES;ii++)
566 if(FlashInternal_eraseSector(addr, true))
575 bool FlashCtl_programMemory(void* src, void* dest, uint32_t length)
577 uint32_t destAddr, srcAddr;
580 /* Casting to integers */
581 srcAddr = (uint32_t)src;
582 destAddr = (uint32_t)dest;
584 /* Enabling word programming */
585 FlashCtl_enableWordProgramming(FLASH_IMMEDIATE_WRITE_MODE);
590 /* Taking care of byte accesses */
591 while ((destAddr & 0x03) && length > 0)
593 if(!_FlashCtl_Program8(srcAddr,destAddr))
595 goto FlashProgramCleanUp;
605 /* Taking care of word accesses */
606 while ((destAddr & 0x0F) && (length > 3))
608 if (!_FlashCtl_Program32(srcAddr, destAddr))
610 goto FlashProgramCleanUp;
620 /* Remaining byte accesses */
623 if(!_FlashCtl_Program8(srcAddr,destAddr))
625 goto FlashProgramCleanUp;
635 /* If we got this far that means that we succeeded */
639 FlashCtl_disableWordProgramming();
644 void FlashCtl_setProgramVerification(uint32_t verificationSetting)
646 if ((verificationSetting & FLASH_BURSTPOST))
647 BITBAND_PERI(FLCTL->rPRGBRST_CTLSTAT.r, FLCTL_PRGBRST_CTLSTAT_AUTO_PST_OFS) =
650 if ((verificationSetting & FLASH_BURSTPRE))
651 BITBAND_PERI(FLCTL->rPRGBRST_CTLSTAT.r, FLCTL_PRGBRST_CTLSTAT_AUTO_PRE_OFS) =
654 if ((verificationSetting & FLASH_REGPRE))
655 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_VER_PRE_OFS) = 1;
657 if ((verificationSetting & FLASH_REGPOST))
658 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_VER_PST_OFS) = 1;
661 void FlashCtl_clearProgramVerification(uint32_t verificationSetting)
663 if ((verificationSetting & FLASH_BURSTPOST))
664 BITBAND_PERI(FLCTL->rPRGBRST_CTLSTAT.r, FLCTL_PRGBRST_CTLSTAT_AUTO_PST_OFS) =
667 if ((verificationSetting & FLASH_BURSTPRE))
668 BITBAND_PERI(FLCTL->rPRGBRST_CTLSTAT.r, FLCTL_PRGBRST_CTLSTAT_AUTO_PRE_OFS) =
671 if ((verificationSetting & FLASH_REGPRE))
672 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_VER_PRE_OFS) = 0;
674 if ((verificationSetting & FLASH_REGPOST))
675 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_VER_PST_OFS) = 0;
679 void FlashCtl_enableWordProgramming(uint32_t mode)
681 if (mode == FLASH_IMMEDIATE_WRITE_MODE)
683 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_ENABLE_OFS) = 1;
684 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_MODE_OFS) = 0;
686 } else if (mode == FLASH_COLLATED_WRITE_MODE)
688 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_ENABLE_OFS) = 1;
689 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_MODE_OFS) = 1;
693 void FlashCtl_disableWordProgramming(void)
695 BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_ENABLE_OFS) = 0;
698 uint32_t FlashCtl_isWordProgrammingEnabled(void)
700 if (!BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_ENABLE_OFS))
703 } else if (BITBAND_PERI(FLCTL->rPRG_CTLSTAT.r, FLCTL_PRG_CTLSTAT_MODE_OFS))
704 return FLASH_COLLATED_WRITE_MODE;
706 return FLASH_IMMEDIATE_WRITE_MODE;
709 void FlashCtl_setWaitState(uint32_t flashBank, uint32_t waitState)
711 if (flashBank == FLASH_BANK0)
713 FLCTL->rBANK0_RDCTL.r =
714 (FLCTL->rBANK0_RDCTL.r & ~FLCTL_BANK0_RDCTL_WAIT_M)
716 } else if (flashBank == FLASH_BANK1)
718 FLCTL->rBANK1_RDCTL.r =
719 (FLCTL->rBANK1_RDCTL.r & ~FLCTL_BANK1_RDCTL_WAIT_M)
727 uint32_t FlashCtl_getWaitState(uint32_t flashBank)
729 if (flashBank == FLASH_BANK0)
731 return FLCTL->rBANK0_RDCTL.b.bWAIT;
732 } else if (flashBank == FLASH_BANK1)
734 return FLCTL->rBANK1_RDCTL.b.bWAIT;
742 void FlashCtl_enableInterrupt(uint32_t flags)
744 FLCTL->rIE.r |= flags;
747 void FlashCtl_disableInterrupt(uint32_t flags)
749 FLCTL->rIE.r &= ~flags;
752 uint32_t FlashCtl_getInterruptStatus(void)
754 return FLCTL->rIFG.r;
757 uint32_t FlashCtl_getEnabledInterruptStatus(void)
759 return FlashCtl_getInterruptStatus() & FLCTL->rIE.r;
762 void FlashCtl_clearInterruptFlag(uint32_t flags)
764 FLCTL->rCLRIFG.r |= flags;
767 void FlashCtl_registerInterrupt(void (*intHandler)(void))
770 // Register the interrupt handler, returning an error if an error occurs.
772 Interrupt_registerInterrupt(INT_FLCTL, intHandler);
775 // Enable the system control interrupt.
777 Interrupt_enableInterrupt(INT_FLCTL);
780 void FlashCtl_unregisterInterrupt(void)
783 // Disable the interrupt.
785 Interrupt_disableInterrupt(INT_FLCTL);
788 // Unregister the interrupt handler.
790 Interrupt_unregisterInterrupt(INT_FLCTL);