|
请教一个参数传递问题(msp430f5438A)
[复制链接]
函数作用是删除flash中的一个segment,可是起始地址怎么也传不进去,请大家帮忙看看问题出在哪? 代码如下:
#include "msp430.h" #include "adc.h" //#include "flash.h"
long i,j; int temp[3]; unsigned long Flash_Addr;
void FlashSegErase(unsigned long pAddr) { _bic_SR_register (GIE); char * Flash_ptr = (char *)pAddr; while (BUSY & FCTL3); FCTL3 = FWKEY; FCTL1 = FWKEY + ERASE; *Flash_ptr = 0; while (BUSY & FCTL3); FCTL3 = FWKEY + LOCK;
_bis_SR_register (GIE); }
void main(void) { WDTCTL = WDTPW + WDTHOLD;
i=25000; j=0; Flash_Addr = 0x030000;
initADC(); FlashSegErase(Flash_Addr); while (1) { ADC12CTL0 |= ADC12SC; _bis_SR_register (GIE); i++; } }
#pragma vector = ADC12_VECTOR __interrupt void ADC12_ISR(void) {
temp[0] = ADC12MEM1;
Flash_Addr++; temp[1] = ADC12MEM2; temp[2] = ADC12MEM3;
}
|
|