sector怎么读

sector怎么读,第1张

sector是读:英 [ˈsektə]。

This stifles the development of the financial sector .这就遏制了金融部门的发展Sectors of it represent corresponding fractions of a wavelength .它的各个弧段则代表一个波长的相应分数。

I reiterated that defenses in the southern sector should be perfected .我一再说明南部的防御应力求稳定。

This sector is small in relation to its enormous rural population .与其巨大的农业人口比这一部门显得很小。

This approach parallels procedures in other sectors of the economy .这个方法与经济的其它部门的程序同时并行。It's difficult to find sector in a sentence. 用sector造句挺难的

近期 我也遇到了类似的问题,

不过我用的是LPC2214芯片,解决办法应该类似,

在调用IAP程序之前,要保证所有的中断是关闭状态,然后

uint8 a[10]

uchar i

for(i=0i<10i++)

{

a[i]=0x0B

}

SelSector(START_SECTOR,END_SECTOR)

//选择扇区 将要保存的数据放在,第十扇区,

EraseSector(START_SECTOR,END_SECTOR)

//擦除扇区

BlankCHK(START_SECTOR,END_SECTOR)

//查空扇区

SelSector(START_SECTOR,END_SECTOR)

//选择扇区 将要保存的数据放在,第十扇区,

RamToFlash(START_ADDR,(uint32)p_Config_Init,BYTE_NUM_1)

SelSector(START_SECTOR,END_SECTOR)

//选择扇区 将要保存的数据放在,第十扇区,

RamToFlash(BAK_ONE_START_ADDR,(uint32)p_Config_Bak,BYTE_NUM_1)

前面定义一个数组并进行初始化没有什么实质意义,但是却能够使程序正常运行,我想应该是在 *** 作时RAM地址出现冲突,以至于使SelSector(START_SECTOR,END_SECTOR)会进入“取指令中断错误”。加上前面对数组定义可能会对RAM地址有所影响,从而使对IAP的 *** 作能够正常进行。

我所用的是LPC2214,可能和你的问题不太一样,试试吧!

coffeegg1985 这位老兄看得很仔细,我再补充一点,

#include <stdio.h>

#include<stdlib.h>

#include <string.h>

int DATA[63]// DATA[]没定义既然是大写干脆就帮你定义成全局变量了

struct sector {

unsigned char ID_START[13]

unsigned int ID_SYNC:8

unsigned int TRACK_NUMBER:16

unsigned int SECTOR_NUMBER:8

unsigned char DATA_START[13]

unsigned int DATA_SYNC:8

unsigned char DATA[64]

unsigned int ERC:16

}

struct sector sect1

struct sector sect2

struct sector sect3

struct sector *p1

struct sector *p2

struct sector *p3

//*********Format the Data***********//

void format (struct sector *p1)

{

int i,j

for(j=1j<=3j++)

{

for(i=0i<=12i++)

{

p1->ID_START[i]=0x00}

p1->ID_SYNC=0xA5

p1->TRACK_NUMBER=31

p1->SECTOR_NUMBER=j

for(i=0i<=12i++)

{

p1->DATA_START[i]=0x00}

p1->DATA_SYNC=0xA5

for(i=0i<=63i++)

{

p1->DATA[i]=0xF3}

p1->ERC=0

}

}

//*****Reading the Data from File****//

void reading (struct sector *p1)

{

int i,c

FILE*fp

fp=fopen("C://data.txt","r")

if((fp=fopen("C://data.txt","r"))==NULL)

{

printf("Error. Cannot read the file.\n")

exit(1)}

else

{

do{

c=fgetc(fp)

for(i=0i<=63i++)

{

p1->DATA[i]=c}

}

while(c!='#')

printf("File finished.\n")

exit(0)

fclose(fp)

}

}

//**********Check the Error**********//

void error_check(struct sector *p1)

{

int old=0

int new1

int i

for(i=0i<=63i++)

{

new1=(old*13+DATA[i])%65536

old=new1

}

}

//********Dumping the Sectors********//

void dumping(struct sector *p1)

{

int i,c

do{

c=DATA[i]

putchar(c)

i++

}

while(c!='#'&&i<=63)

}

//***********Main Function***********//

void main()

{

p1=&sect1

p2=&sect2

p3=&sect3

printf("Format Sector1...\n")// 这里的分号掉了,复制时也 *** 点心

format(p1)

error_check(p1)

printf("Reading Sector1...\n")// 这里的分号掉了,复制时也 *** 点心!

reading(p1)

error_check(p1)

printf("Dumping Sector1:\n")// 这里的分号掉了,复制时也 *** 点心!

dumping(p1)

printf("Format Sector2...\n")// 这里的分号掉了,复制时也 *** 点心!

format(p2)

error_check(p2)

printf("Reading Sector2...\n")// 这里的分号掉了,复制时也 *** 点心!

reading(p2)

error_check(p2)

printf("Dumping Sector2:\n")// 这里的分号掉了,复制时也 *** 点心!

dumping(p2)

printf("Format Sector3...\n")// 这里的分号掉了,复制时也 *** 点心!

format(p3)

error_check(p3)

printf("Reading Sector3...\n")// 这里的分号掉了,复制时也 *** 点心!

reading(p3)

error_check(p3)

printf("Dumping Sector3:\n")// 这里的分号掉了,复制时也 *** 点心!

dumping(p3)

}

其他和那位老兄差不多,也没有多大出处!


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/11464718.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存