在线时间1 小时
UID110416
ST金币0
蝴蝶豆0
注册时间2009-2-18
初级会员
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-7-17 20:09:20
|
显示全部楼层
a0a.1 0b0c
RE:STVP 如何将Option Byte 里的ROP改为disable
#include "stm8s.h"
#include "stm8s105C6.h"
#include "stm8s_beep.h"
#include "stm8s_flash.h"
#include "stm8s_clk.h"
#include "stm8s_gpio.h"
void delay(unsigned int x)
{
unsigned int m,n;
for(m=x;m>0;m--)
for(n=200;n>0;n--);
}
void BEEPer_Init(void)
{
int i;
FLASH_DUKR = 0xae;
;
FLASH_DUKR = 0x56;
;
i=10;
while(i--);
while(!(FLASH_IAPSR & 0x08));
FLASH_CR2 = 0x80;
i=10;
while(i--);
FLASH_NCR2 = 0x7f;
i=10;
while(i--);
*((unsigned char *)0x4803) = 0x80;
i=10;
while(i--);
*((unsigned char *)0x4804) = 0x7f;
}
main()
{
BEEPer_Init();
while(1)
{
BEEP_CSR = 0x2e;
delay(1500);
BEEP_CSR = 0x20;
delay(1500);
}
} |
|