Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void write_SegC(char value)
- {
- //__disable_interrupt(); // 5xx Workaround: Disable global
- // interrupt while erasing. Re-Enable
- // GIE if needed
- FCTL3 = FWKEY; // Clear Lock bit
- FCTL1 = FWKEY+ERASE; // Set Erase bit
- *(unsigned int *)Flash_ptr = 0; // Dummy write to erase Flash seg
- FCTL1 = FWKEY+WRT; // Set WRT bit for write operation
- *Flash_ptr++ = data; // Write value to flash
- FCTL1 = FWKEY; // Clear WRT bit
- FCTL3 = FWKEY+LOCK; // Set LOCK bit
- }
- void read_SegC(void)
- {
- unsigned long i;
- Flash_ptr=0x20000;
- for(i = 0; i < 8; i++)
- {
- while(!(UCA1IFG & UCTXIFG));
- UCA1TXBUF=*Flash_ptr++; // Write long int to Flash
- }
- while(!(UCA1IFG & UCTXIFG));
- UCA1TXBUF='&'; // Send EOF
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement