@@ -1,11 +1,70 @@
|
|||||||
#include "buzzer.h"
|
#include "buzzer.h"
|
||||||
|
|
||||||
struct notes *notes;
|
notes_buff buzzer_play_buff;
|
||||||
|
|
||||||
void play_ones(uint16_t freq,uint8_t dutya)
|
void BUZZER_PLAY(uint16_t freq,float duty)
|
||||||
{
|
{
|
||||||
|
TIM2->ARR = (uint32_t)((72000000/freq)-1);
|
||||||
|
TIM2->CCR3 = (uint32_t)(((72000000/freq)-1)*((float)duty/100));
|
||||||
|
}
|
||||||
|
|
||||||
TIM2->ARR = (uint32_t)((72000000/freq)-1);TIM2->CCR3 = (uint32_t)(((72000000/freq)-1)*((float)dutya/100));
|
void BUZZER_PLAY_INIT()
|
||||||
|
{
|
||||||
|
buzzer_play_buff.head=NULL;
|
||||||
|
buzzer_play_buff.end=NULL;
|
||||||
|
buzzer_play_buff.play_busy=0;
|
||||||
|
|
||||||
|
BUZZER_PLAY(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BUZZER_PLAY_NOTES(uint16_t freq,uint16_t delay,uint8_t duty)
|
||||||
|
{
|
||||||
|
note *buff,*buff2;
|
||||||
|
buff =(note*)malloc(sizeof(note));
|
||||||
|
if(buff!=NULL)
|
||||||
|
{
|
||||||
|
buff->delay=delay;
|
||||||
|
buff->duty=duty;
|
||||||
|
buff->freq=freq;
|
||||||
|
buff->next=NULL;
|
||||||
|
}else{return ;}
|
||||||
|
if(buzzer_play_buff.head==NULL)
|
||||||
|
{
|
||||||
|
buzzer_play_buff.head=buff;
|
||||||
|
buzzer_play_buff.end=buff;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
buff2=buzzer_play_buff.end;
|
||||||
|
buff2->next=buff;
|
||||||
|
buzzer_play_buff.end=buff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BUZZER_PLAY_SERVER()
|
||||||
|
{
|
||||||
|
note *buff;
|
||||||
|
char data;
|
||||||
|
if(buzzer_play_buff.play_busy)
|
||||||
|
{
|
||||||
|
if(HAL_GetTick()>buzzer_play_buff.play_time)
|
||||||
|
{
|
||||||
|
buzzer_play_buff.play_busy=0;
|
||||||
|
BUZZER_PLAY(0,0);
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
if(buzzer_play_buff.head!=NULL)
|
||||||
|
{
|
||||||
|
buzzer_play_buff.play_busy=1;
|
||||||
|
buzzer_play_buff.play_time=HAL_GetTick()+buzzer_play_buff.head->delay;
|
||||||
|
buff=buzzer_play_buff.head->next;
|
||||||
|
BUZZER_PLAY(buzzer_play_buff.head->freq,buzzer_play_buff.head->duty);
|
||||||
|
free(buzzer_play_buff.head);
|
||||||
|
buzzer_play_buff.head=buff;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,31 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void play_ones(uint16_t freq,uint8_t dutya);
|
|
||||||
|
typedef struct note
|
||||||
|
{
|
||||||
|
struct note *next;
|
||||||
|
uint16_t freq; //??
|
||||||
|
uint8_t duty; //???
|
||||||
|
uint16_t delay; //????
|
||||||
|
}note;
|
||||||
|
|
||||||
|
typedef struct notes_buff
|
||||||
|
{
|
||||||
|
note *head;
|
||||||
|
note *end;
|
||||||
|
uint32_t play_time;
|
||||||
|
uint8_t play_busy:1;
|
||||||
|
|
||||||
|
}notes_buff;
|
||||||
|
|
||||||
|
|
||||||
|
void BUZZER_PLAY_INIT();
|
||||||
|
void BUZZER_PLAY_NOTES(uint16_t freq,uint16_t delay,uint8_t duty);
|
||||||
|
void BUZZER_PLAY_SERVER();
|
||||||
|
void BUZZER_PLAY(uint16_t freq,float duty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* BUZZER_H_ */
|
#endif /* BUZZER_H_ */
|
||||||
|
|||||||
@@ -1,15 +1,225 @@
|
|||||||
#include "morsr.h"
|
#include "morsr.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define morsecodenum 38
|
||||||
|
const struct morsecode morsecodes[morsecodenum]=
|
||||||
|
{
|
||||||
|
{
|
||||||
|
2,0x40,'A'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x80,'B'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0xa0,'C'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0x80,'D'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,0x00,'E'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x20,'F'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0xc0,'G'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x00,'H'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
2,0x00,'I'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x70,'J'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0xa0,'K'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x40,'L'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
2,0xc0,'M'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
2,0x80,'N'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0xe0,'O'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x60,'P'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0xd0,'Q'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0x40,'R'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0x00,'S'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1,0x80,'T'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0x20,'U'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x10,'V'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
3,0x60,'W'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0x90,'X'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0xb0,'Y'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
4,0xc0,'Z'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x78,'1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x38,'2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x18,'3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x08,'4'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x00,'5'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x80,'6'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0xc0,'7'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0xe0,'8'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0xf0,'9'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0xf8,'0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
6,0x30,'?'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
5,0x90,'/'
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
char get_morse_code(uint8_t len,uint8_t code)
|
||||||
|
{
|
||||||
|
for(int a=0;a<morsecodenum;a++)
|
||||||
|
{
|
||||||
|
if((morsecodes[a].len==len)&&(morsecodes[a].code==code))
|
||||||
|
{
|
||||||
|
return morsecodes[a].letter;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char moser_buff[64+8]={0};
|
||||||
|
uint8_t moser_buff_int=0;
|
||||||
|
uint8_t moser_code_len=0;
|
||||||
|
uint8_t moser_code=0;
|
||||||
|
uint32_t moser_tick_time=0;
|
||||||
|
uint8_t moser_input_flag=0;
|
||||||
|
|
||||||
|
void mo_server()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(moser_input_flag==1&&HAL_GetTick()>moser_tick_time)
|
||||||
|
{
|
||||||
|
moser_input_flag=0;
|
||||||
|
for(int a=0;a<8;a++)
|
||||||
|
{
|
||||||
|
moser_buff[moser_buff_int+a]='\0';
|
||||||
|
}
|
||||||
|
moser_buff[moser_buff_int]=get_morse_code(moser_code_len,moser_code);
|
||||||
|
moser_buff_int+=1;
|
||||||
|
if(moser_buff_int==64)
|
||||||
|
{
|
||||||
|
for(int a=0;a<64;a++)
|
||||||
|
{
|
||||||
|
moser_buff[a]='\0';
|
||||||
|
}
|
||||||
|
moser_buff_int=0;
|
||||||
|
}
|
||||||
|
moser_code_len=0;
|
||||||
|
moser_code=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void mo_di()
|
||||||
|
{
|
||||||
|
moser_buff[moser_buff_int+moser_code_len]='.';
|
||||||
|
moser_code_len+=1;
|
||||||
|
if(moser_code_len==8){moser_code_len=0;}
|
||||||
|
moser_tick_time=HAL_GetTick()+400;
|
||||||
|
moser_input_flag=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mo_da()
|
||||||
|
{
|
||||||
|
moser_buff[moser_buff_int+moser_code_len]='-';
|
||||||
|
moser_code|=(0x80>>moser_code_len);
|
||||||
|
moser_code_len+=1;
|
||||||
|
if(moser_code_len==8){moser_code_len=0;}
|
||||||
|
moser_tick_time=HAL_GetTick()+400;
|
||||||
|
moser_input_flag=1;
|
||||||
|
}
|
||||||
|
|
||||||
void mo_one_tick(uint8_t i)
|
void mo_one_tick(uint8_t i)
|
||||||
|
{
|
||||||
|
static uint8_t last_input=1;
|
||||||
|
static uint32_t tick_time;
|
||||||
|
uint16_t tick_time_cat;
|
||||||
|
if(i!=last_input)
|
||||||
|
{
|
||||||
|
last_input=i;
|
||||||
|
|
||||||
|
switch(last_input)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
tick_time=HAL_GetTick();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
tick_time_cat=HAL_GetTick()-tick_time;
|
||||||
|
if(tick_time_cat<100)
|
||||||
|
{
|
||||||
|
|
||||||
|
}else if(tick_time_cat<200)
|
||||||
|
{
|
||||||
|
mo_di();
|
||||||
|
}else if(tick_time_cat<400)
|
||||||
|
{
|
||||||
|
mo_da();
|
||||||
|
}else
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,18 @@
|
|||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
extern char moser_buff[64+8];
|
||||||
|
|
||||||
|
struct morsecode
|
||||||
|
{
|
||||||
|
uint8_t len;
|
||||||
|
uint8_t code;
|
||||||
|
char letter;
|
||||||
|
};
|
||||||
|
|
||||||
|
void mo_server();
|
||||||
|
void mo_di();
|
||||||
|
void mo_da();
|
||||||
void mo_one_tick(uint8_t i);
|
void mo_one_tick(uint8_t i);
|
||||||
|
|
||||||
#endif /* MYMAIN_H_ */
|
#endif /* MYMAIN_H_ */
|
||||||
@@ -13,159 +13,13 @@
|
|||||||
|
|
||||||
#define morse_play_t1 50
|
#define morse_play_t1 50
|
||||||
#define morse_play_t2 (morse_play_t1*3)
|
#define morse_play_t2 (morse_play_t1*3)
|
||||||
#define morse_play_hz 100
|
#define morse_play_hz 1000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define morsecodenum 38
|
|
||||||
const struct morsecode morsecodes[morsecodenum]=
|
|
||||||
{
|
|
||||||
{
|
|
||||||
2,0x40,'A'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x80,'B'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0xa0,'C'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0x80,'D'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
1,0x00,'E'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x20,'F'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0xc0,'G'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x00,'H'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
2,0x00,'I'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x70,'J'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0xa0,'K'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x40,'L'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
2,0xc0,'M'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
2,0x80,'N'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0xe0,'O'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x60,'P'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0xd0,'Q'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0x40,'R'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0x00,'S'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
1,0x80,'T'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0x20,'U'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x10,'V'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
3,0x60,'W'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0x90,'X'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0xb0,'Y'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
4,0xc0,'Z'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x78,'1'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x38,'2'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x18,'3'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x08,'4'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x00,'5'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x80,'6'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0xc0,'7'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0xe0,'8'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0xf0,'9'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0xf8,'0'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
6,0x30,'?'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5,0x90,'/'
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const char testbmp[]=
|
|
||||||
{
|
|
||||||
0x00,0x00,0x02,0x00,0x0F,0x00,0x00,0x0F,0x00,0x0F,0x00,0x00,0x09,0x00,0x0F,0x0F,
|
|
||||||
0x00,0x0D,0x80,0x0F,0x05,0xC0,0x18,0x80,0x0F,0x0C,0x70,0xF0,0xC0,0x0F,0x08,0x3F,
|
|
||||||
0x81,0x70,0x0F,0x04,0x14,0x7F,0xF0,0x0F,0x0C,0x01,0xAC,0x18,0x0F,0x04,0x0F,0xC0,
|
|
||||||
0x38,0x0F,0x06,0x78,0x07,0xEC,0x0F,0x0D,0xC0,0x7E,0x86,0x0F,0x07,0x03,0xC0,0x06,
|
|
||||||
0x0F,0x06,0x1E,0x00,0x0E,0x0F,0x0C,0x70,0x00,0x0F,0x0F,0x0D,0xC0,0x10,0x07,0x8F,
|
|
||||||
0x0F,0x00,0x18,0x01,0x8F,0x1C,0x00,0x18,0x1F,0xCF,0x18,0x00,0x18,0x75,0xCF,0x38,
|
|
||||||
0x00,0x00,0x3F,0x4F,0x38,0x00,0x00,0x04,0x6F,0x38,0x00,0x00,0x06,0x3F,0x38,0x00,
|
|
||||||
0x00,0x02,0x7F,0x68,0x00,0x00,0x0F,0xFF,0x58,0x00,0x00,0xFA,0x2F,0xC8,0x00,0x03,
|
|
||||||
0xC0,0xEF,0xD8,0x00,0x02,0x0F,0x8F,0x98,0x00,0x00,0x1A,0x0F,0x98,0x00,0x00,0x38,
|
|
||||||
0x0F,0x38,0x00,0x00,0x10,0x0F
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char getmorsecode(uint8_t len,uint8_t code)
|
|
||||||
{
|
|
||||||
for(int a=0;a<morsecodenum;a++)
|
|
||||||
{
|
|
||||||
if((morsecodes[a].len==len)&&(morsecodes[a].code==code))
|
|
||||||
{
|
|
||||||
return morsecodes[a].letter;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
button B1;//创建一个按钮
|
button B1;//创建一个按钮
|
||||||
encoder E1;//创建一个编码器
|
encoder E1;//创建一个编码器
|
||||||
@@ -187,6 +41,20 @@ menu menu_main=
|
|||||||
0,0
|
0,0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void di()
|
||||||
|
{
|
||||||
|
BUZZER_PLAY_NOTES(morse_play_hz,morse_play_t1,50);
|
||||||
|
BUZZER_PLAY_NOTES(0,morse_play_t1,0);
|
||||||
|
mo_di();
|
||||||
|
}
|
||||||
|
|
||||||
|
void da()
|
||||||
|
{
|
||||||
|
BUZZER_PLAY_NOTES(morse_play_hz,morse_play_t2,50);
|
||||||
|
BUZZER_PLAY_NOTES(0,morse_play_t1,0);
|
||||||
|
mo_da();
|
||||||
|
}
|
||||||
|
|
||||||
void mymain()
|
void mymain()
|
||||||
{
|
{
|
||||||
PWR_EN(1);
|
PWR_EN(1);
|
||||||
@@ -199,9 +67,10 @@ void mymain()
|
|||||||
OLED_Init();//屏幕初始化
|
OLED_Init();//屏幕初始化
|
||||||
HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_3);//启动n通道的pwm
|
HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_3);//启动n通道的pwm
|
||||||
HAL_TIM_Base_Start_IT(&htim3);
|
HAL_TIM_Base_Start_IT(&htim3);
|
||||||
|
BUZZER_PLAY_INIT();
|
||||||
MUTE(0);
|
MUTE(0);
|
||||||
|
|
||||||
//play_ones(1000,50);
|
BUZZER_PLAY_NOTES(1000,1000,50);
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
GEI_BUTTON_CODE(&B1);//循环更新按钮
|
GEI_BUTTON_CODE(&B1);//循环更新按钮
|
||||||
@@ -217,8 +86,15 @@ void mymain()
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
//主界面
|
//主界面
|
||||||
|
if(encode_c>0)
|
||||||
|
{
|
||||||
|
di();
|
||||||
|
}
|
||||||
|
if(encode_c<0)
|
||||||
|
{
|
||||||
|
da();
|
||||||
|
}
|
||||||
|
OLED_Str(0,0,8,moser_buff,1);
|
||||||
|
|
||||||
|
|
||||||
fps_++;
|
fps_++;
|
||||||
@@ -250,8 +126,8 @@ void mymain()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mo_server();
|
||||||
|
BUZZER_PLAY_SERVER();
|
||||||
OLED_Cache_to_hardware();//刷新屏幕
|
OLED_Cache_to_hardware();//刷新屏幕
|
||||||
|
|
||||||
if(HAL_GetTick()>run_tick)
|
if(HAL_GetTick()>run_tick)
|
||||||
@@ -277,20 +153,36 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||||||
case 1://通过监测B脚的状态识别正反转
|
case 1://通过监测B脚的状态识别正反转
|
||||||
E1.code+=1;
|
E1.code+=1;
|
||||||
E1.move_flag=1;//发生旋转的标记
|
E1.move_flag=1;//发生旋转的标记
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
E1.code-=1;
|
E1.code-=1;
|
||||||
E1.move_flag=1;
|
E1.move_flag=1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//外部电键输入
|
//外部电键输入
|
||||||
case tack_a_Pin:
|
case tack_a_Pin:
|
||||||
test_code++;
|
switch(tack_a())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
//di();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case tack_b_Pin:
|
case tack_b_Pin:
|
||||||
test_code--;
|
switch(tack_b())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
//da();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
@@ -299,11 +191,11 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
||||||
mo_one_tick(0);
|
//mo_one_tick(0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
|
||||||
mo_one_tick(1);
|
//mo_one_tick(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -14,12 +14,7 @@
|
|||||||
#include "encode.h"
|
#include "encode.h"
|
||||||
#include "hread_interface.h"
|
#include "hread_interface.h"
|
||||||
#include "morsr.h"
|
#include "morsr.h"
|
||||||
struct morsecode
|
|
||||||
{
|
|
||||||
uint8_t len;
|
|
||||||
uint8_t code;
|
|
||||||
char letter;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern TIM_HandleTypeDef htim3;
|
extern TIM_HandleTypeDef htim3;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,38 +27,36 @@ Project File Date: 05/01/2022
|
|||||||
<h2>Output:</h2>
|
<h2>Output:</h2>
|
||||||
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
|
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
|
||||||
Build target 'f103c8t6_KEIL'
|
Build target 'f103c8t6_KEIL'
|
||||||
compiling encode.c...
|
|
||||||
MYDEIVERS\encode.c(64): warning: #1-D: last line of file ends without a newline
|
|
||||||
}
|
|
||||||
MYDEIVERS\encode.c: 1 warning, 0 errors
|
|
||||||
compiling main.c...
|
|
||||||
./MYDEIVERS/oled.h(33): warning: #1295-D: Deprecated declaration OLED_Cache_to_hardware - give arg types
|
|
||||||
void OLED_Cache_to_hardware();
|
|
||||||
./MYDEIVERS/morsr.h(8): warning: #1-D: last line of file ends without a newline
|
|
||||||
#endif /* MYMAIN_H_ */
|
|
||||||
./MYDEIVERS/mymain.h(26): warning: #1295-D: Deprecated declaration mymain - give arg types
|
|
||||||
void mymain();
|
|
||||||
../Core/Src/main.c: 3 warnings, 0 errors
|
|
||||||
compiling mymain.c...
|
compiling mymain.c...
|
||||||
MYDEIVERS\oled.h(33): warning: #1295-D: Deprecated declaration OLED_Cache_to_hardware - give arg types
|
MYDEIVERS\oled.h(33): warning: #1295-D: Deprecated declaration OLED_Cache_to_hardware - give arg types
|
||||||
void OLED_Cache_to_hardware();
|
void OLED_Cache_to_hardware();
|
||||||
MYDEIVERS\morsr.h(8): warning: #1-D: last line of file ends without a newline
|
MYDEIVERS\buzzer.h(27): warning: #1295-D: Deprecated declaration BUZZER_PLAY_INIT - give arg types
|
||||||
|
void BUZZER_PLAY_INIT();
|
||||||
|
MYDEIVERS\buzzer.h(29): warning: #1295-D: Deprecated declaration BUZZER_PLAY_SERVER - give arg types
|
||||||
|
void BUZZER_PLAY_SERVER();
|
||||||
|
MYDEIVERS\morsr.h(15): warning: #1295-D: Deprecated declaration mo_server - give arg types
|
||||||
|
void mo_server();
|
||||||
|
MYDEIVERS\morsr.h(16): warning: #1295-D: Deprecated declaration mo_di - give arg types
|
||||||
|
void mo_di();
|
||||||
|
MYDEIVERS\morsr.h(17): warning: #1295-D: Deprecated declaration mo_da - give arg types
|
||||||
|
void mo_da();
|
||||||
|
MYDEIVERS\morsr.h(20): warning: #1-D: last line of file ends without a newline
|
||||||
#endif /* MYMAIN_H_ */
|
#endif /* MYMAIN_H_ */
|
||||||
MYDEIVERS\mymain.h(26): warning: #1295-D: Deprecated declaration mymain - give arg types
|
MYDEIVERS\mymain.h(21): warning: #1295-D: Deprecated declaration mymain - give arg types
|
||||||
void mymain();
|
void mymain();
|
||||||
MYDEIVERS\mymain.c(192): warning: #188-D: enumerated type mixed with another type
|
MYDEIVERS\mymain.c(60): warning: #188-D: enumerated type mixed with another type
|
||||||
PWR_EN(1);
|
PWR_EN(1);
|
||||||
MYDEIVERS\mymain.c(202): warning: #188-D: enumerated type mixed with another type
|
MYDEIVERS\mymain.c(71): warning: #188-D: enumerated type mixed with another type
|
||||||
MUTE(0);
|
MUTE(0);
|
||||||
MYDEIVERS\mymain.c(225): warning: #223-D: function "sprintf" declared implicitly
|
MYDEIVERS\mymain.c(101): warning: #223-D: function "sprintf" declared implicitly
|
||||||
sprintf(str,"FPS:%d",fps);
|
sprintf(str,"FPS:%d",fps);
|
||||||
MYDEIVERS\mymain.c(325): warning: #1-D: last line of file ends without a newline
|
MYDEIVERS\mymain.c(217): warning: #1-D: last line of file ends without a newline
|
||||||
}
|
}
|
||||||
MYDEIVERS\mymain.c: 7 warnings, 0 errors
|
MYDEIVERS\mymain.c: 12 warnings, 0 errors
|
||||||
linking...
|
linking...
|
||||||
Program Size: Code=8964 RO-data=3812 RW-data=68 ZI-data=3948
|
Program Size: Code=11052 RO-data=3928 RW-data=80 ZI-data=4040
|
||||||
FromELF: creating hex file...
|
FromELF: creating hex file...
|
||||||
"f103c8t6_KEIL\f103c8t6_KEIL.axf" - 0 Error(s), 11 Warning(s).
|
"f103c8t6_KEIL\f103c8t6_KEIL.axf" - 0 Error(s), 12 Warning(s).
|
||||||
|
|
||||||
<h2>Software Packages used:</h2>
|
<h2>Software Packages used:</h2>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -30,12 +30,12 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h)(0x626CE6A4)
|
|||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x626CE6A4)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h)(0x626CE6A4)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h)(0x626CE6A4)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h)(0x626CE6A4)
|
||||||
I (../Drivers/CMSIS/Include/core_cm3.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/core_cm3.h)(0x626CE69C)
|
||||||
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x6025237E)
|
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x6025237E)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_version.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_version.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x626CE6A4)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x626CE6A4)
|
||||||
I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x6025237E)
|
I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x6025237E)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h)(0x626CE6A4)
|
||||||
@@ -545,8 +545,8 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h)(0x626CE6A4)
|
|||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h)(0x626CE6A4)
|
||||||
@@ -577,9 +577,9 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x626CE6A4)
|
|||||||
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x626CE6A4)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x626CE6A4)
|
||||||
I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x6025237E)
|
I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x6025237E)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h)(0x626CE6A4)
|
||||||
@@ -612,8 +612,8 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h)(0x626CE6A4)
|
|||||||
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x6025237E)
|
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x6025237E)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_version.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_version.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_compiler.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x626CE69C)
|
I (../Drivers/CMSIS/Include/cmsis_armcc.h)(0x626CE69C)
|
||||||
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x626CE6A4)
|
I (../Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h)(0x626CE6A4)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h)(0x626CE6A4)
|
||||||
I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x6025237E)
|
I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x6025237E)
|
||||||
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x626CE6A4)
|
I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h)(0x626CE6A4)
|
||||||
@@ -672,8 +672,8 @@ I (../Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h)(0x626CE6A4)
|
|||||||
-I.\RTE\_f103c8t6_KEIL
|
-I.\RTE\_f103c8t6_KEIL
|
||||||
|
|
||||||
-IC:\Users\wuwen\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Include
|
-IC:\Users\wuwen\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Include
|
||||||
|
|
||||||
-IC:\Users\wuwen\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.4.0\Device\Include
|
-IC:\Users\wuwen\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.4.0\Device\Include
|
||||||
|
|
||||||
-D__UVISION_VERSION="536" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
|
-D__UVISION_VERSION="536" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103xB
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user