- #include "stm32f10x.h"
- #include "led.h"
- #include "delay.h"
- #include "key.h"
- #include "sys.h"
- #include "beep.h"
- int main(void)
- {
- u8 key;
- delay_init();
- LED_Init();
- KEY_Init();
- BEEP_Init();
- LED0=0;
- while(1)
- {
- key =KEY_Scan(0);
- if(KEY1==0)
- {
- while(1)
- {
- BEEP=1;
- LED1=1;
- if(BEEP==1)
- {
- LED0=1-LED0;
- delay_ms(300);
- key=KEY_Scan(0); //
- if(KEY0==0)
- {
- BEEP=0;
- break;
- }
- }
- }
- }
- if(KEY0==0)
- {
- LED1=0; //LED1
- LED0=1; //LED0
- BEEP=0;
- }
- else delay_ms(20);
- }
- }
复制代码
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'F:\91UserData\qianrushi\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
assembling startup_stm32f10x_hd.s...
compiling core_cm3.c...
compiling main.c...
main.c(17): warning: #223-D: function "KEY_Scan" declared implicitly
key =KEY_Scan(0);
main.c(9): warning: #550-D: variable "key" was set but never used
u8 key;
main.c: 2 warnings, 0 errors
compiling stm32f10x_it.c...
compiling system_stm32f10x.c...
compiling stm32f10x_wwdg.c...
compiling stm32f10x_usart.c...
compiling stm32f10x_tim.c...
compiling stm32f10x_spi.c...
compiling stm32f10x_sdio.c...
compiling stm32f10x_rtc.c...
compiling stm32f10x_rcc.c...
compiling stm32f10x_pwr.c...
compiling stm32f10x_iwdg.c...
compiling stm32f10x_i2c.c...
compiling stm32f10x_gpio.c...
compiling stm32f10x_fsmc.c...
compiling stm32f10x_flash.c...
compiling stm32f10x_exti.c...
compiling stm32f10x_dbgmcu.c...
compiling stm32f10x_dma.c...
compiling stm32f10x_dac.c...
compiling stm32f10x_crc.c...
compiling stm32f10x_cec.c...
compiling stm32f10x_can.c...
compiling stm32f10x_bkp.c...
compiling stm32f10x_adc.c...
compiling misc.c...
compiling usart.c...
..\SYSTEM\usart\usart.c(48): warning: #260-D: explicit type is missing ("int" assumed)
_sysexit(int x)
..\SYSTEM\usart\usart.c: 1 warning, 0 errors
compiling delay.c...
compiling sys.c...
compiling beep.c...
..\HARDWARE\beep\beep.c(13): warning: #1-D: last line of file ends without a newline
..\HARDWARE\beep\beep.c: 1 warning, 0 errors
compiling led.c...
compiling key.c...
linking...
..\beep.axf: Error: L6915E: Library reports error: __use_no_semihosting was requested, but _sys_exit was referenced
Not enough information to list load addresses in the image map.
Finished: 1 information, 0 warning and 1 error messages.
"..\beep.axf" - 1 Error(s), 4 Warning(s).
Target not created.
Build Time Elapsed: 00:00:09
|