增加采样状态显示,待调试
This commit is contained in:
parent
bc2e32c797
commit
b0ee10ea48
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -655,7 +655,7 @@
|
|||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>36</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\User\OSC\OSC.c</PathWithFileName>
|
||||
|
|
|
@ -30,23 +30,23 @@ rt_thread_t KeyScan_thread = RT_NULL;
|
|||
|
||||
|
||||
//可设置项
|
||||
char* RangeMode[] = {"Auto", "Manu"};
|
||||
char* SamplStatus[] = {"Stop", "Run"};
|
||||
char* TriggerMode[] = {"Up", "Down"};
|
||||
char* SamplingMode[] = {"A", "N", "S"};
|
||||
uint16_t TimePerDiv_Group[] = {2, 5, 10, 20, 50, 100, 200, 500};
|
||||
|
||||
int8_t RangeModeNrb =0;
|
||||
int8_t SamplStatusNrb =0;
|
||||
int8_t TriggerModeNrb = 0;
|
||||
int8_t SamplingModeNrb =0;
|
||||
uint8_t TimePerDivOderNbr = sizeof(TimePerDiv_Group)/sizeof(TimePerDiv_Group[0]);
|
||||
int8_t TimePerDivOder = 0;//当前每格间隔时间的序号
|
||||
|
||||
|
||||
float CurTriggerValue = 0.0; //代号0,触发阀值
|
||||
char* CurRangeMode = {"Auto"}; //代号1,量程模式,0:自动,1:手动
|
||||
char* CurTriggerMode = {"Up"}; //代号2,触发模式,0:下降沿触发,1:上升沿触发
|
||||
float CurTriggerValue = 0.0; //代号0,触发阀值
|
||||
char* CurSamplStatus = {"Run"}; //代号1,采样状态,0:停止采样,1:正在采样
|
||||
char* CurTriggerMode = {"Up"}; //代号2,触发模式,0:下降沿触发,1:上升沿触发
|
||||
char* CurSamplingMode = {"A"}; //代号3,采样模式,0:自动,1:普通,2:单次
|
||||
uint16_t CurTimePerDiv = 500; //代号4,每格代表的时间间隔
|
||||
uint16_t CurTimePerDiv = 500; //代号4,每格代表的时间间隔
|
||||
|
||||
//要显示的信息
|
||||
float WaveFrq = 0.0;//波形频率,单位kHz
|
||||
|
@ -82,12 +82,12 @@ static void Setting_do(uint8_t CurSetItem, int8_t Operation)
|
|||
}
|
||||
case 1:
|
||||
{
|
||||
RangeModeNrb += Operation;
|
||||
if(RangeModeNrb < 0)
|
||||
RangeModeNrb = 0;
|
||||
if(RangeModeNrb > 1)
|
||||
RangeModeNrb = 1;
|
||||
CurRangeMode = RangeMode[RangeModeNrb];
|
||||
SamplStatusNrb += Operation;
|
||||
if(SamplStatusNrb < 0)
|
||||
SamplStatusNrb = 0;
|
||||
if(SamplStatusNrb > 1)
|
||||
SamplStatusNrb = 1;
|
||||
CurSamplStatus = SamplStatus[SamplStatusNrb];
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
|
@ -124,7 +124,7 @@ static void Setting_do(uint8_t CurSetItem, int8_t Operation)
|
|||
break;
|
||||
}
|
||||
rt_kprintf("TriggerValue: %.1f\n",CurTriggerValue);
|
||||
rt_kprintf("RangeMode: %s\n",CurRangeMode);
|
||||
rt_kprintf("RangeMode: %s\n",CurSamplStatus);
|
||||
rt_kprintf("TriggerMode: %s\n",CurTriggerMode);
|
||||
rt_kprintf("Sampling_mode: %s\n",CurSamplingMode);
|
||||
rt_kprintf("TimePerDiv: %d\n",CurTimePerDiv);
|
||||
|
@ -155,7 +155,7 @@ void Setting_Inf_Update(uint8_t CurSetItem)
|
|||
case 1:
|
||||
{
|
||||
ILI9341_Clear(260, (((sFONT *)LCD_GetFont())->Height)*1, 60, (((sFONT *)LCD_GetFont())->Height));
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*1, CurRangeMode);
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*1, CurSamplStatus);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
|
|
|
@ -12,12 +12,12 @@ extern rt_mq_t getwave_status_queue;
|
|||
extern rt_thread_t GetWave_thread;
|
||||
|
||||
//可设置项
|
||||
extern int8_t RangeModeNrb;
|
||||
extern int8_t SamplStatusNrb;
|
||||
extern int8_t TriggerModeNrb;
|
||||
extern int8_t SamplingModeNrb;
|
||||
|
||||
extern float CurTriggerValue; //代号0,触发阀值
|
||||
extern char* CurRangeMode; //代号1,量程模式,0:自动,1:手动
|
||||
extern char* CurSamplStatus; //代号1,采样状态,0:停止采样,1:正在采样
|
||||
extern char* CurTriggerMode; //代号2,触发模式,0:下降沿触发,1:上升沿触发,2:上升沿下降沿触发
|
||||
extern char* CurSamplingMode; //代号3,采样模式,0:自动,1:普通,2:单次
|
||||
extern uint16_t CurTimePerDiv; //代号4,每格代表的时间间隔
|
||||
|
|
|
@ -76,7 +76,7 @@ void rt_hw_board_init()
|
|||
char dispBuff[100];
|
||||
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*0, "0.0 V");
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*1, CurRangeMode);
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*1, CurSamplStatus);
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*2, CurTriggerMode);
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*3, CurSamplingMode);
|
||||
/*使用c标准库把变量转化成字符串*/
|
||||
|
|
|
@ -44,18 +44,49 @@ void BASIC_TIM_IRQHandler (void)
|
|||
*/
|
||||
void EXTI2_IRQHandler(void)
|
||||
{
|
||||
if(EXTI_GetITStatus(EXTI_Line2) != RESET)
|
||||
uint8_t i=42,j=24, k=92, ClickTime;
|
||||
while(EXTI_GetITStatus(EXTI_Line2) != RESET)
|
||||
{
|
||||
EXTI_ClearITPendingBit(EXTI_Line2);
|
||||
}
|
||||
ClickTime = 1;
|
||||
do
|
||||
{
|
||||
do
|
||||
{
|
||||
//Ôٴΰ´ÏÂ
|
||||
if (EXTI_GetITStatus(EXTI_Line2) != RESET)
|
||||
{
|
||||
ClickTime = 2;
|
||||
rt_mq_send(setting_data_queue, &setting_data_set, sizeof(setting_data_set));
|
||||
}while (--k);
|
||||
} while (--j);
|
||||
} while (--i);
|
||||
|
||||
if(ClickTime == 1)
|
||||
{
|
||||
rt_interrupt_enter();
|
||||
rt_mq_send(setting_data_queue,
|
||||
&setting_data_set,
|
||||
sizeof(setting_data_set));
|
||||
if(SamplStatusNrb == 0)
|
||||
{
|
||||
SamplStatusNrb = 1;
|
||||
rt_thread_resume(GetWave_thread);
|
||||
LED2_ON;
|
||||
}
|
||||
else if(SamplStatusNrb == 1)
|
||||
{
|
||||
SamplStatusNrb = 0;
|
||||
rt_thread_suspend(GetWave_thread);
|
||||
LED2_OFF;
|
||||
}
|
||||
ILI9341_Clear(260, (((sFONT *)LCD_GetFont())->Height)*6, 60, (((sFONT *)LCD_GetFont())->Height));
|
||||
ILI9341_DispString_EN(260, (((sFONT *)LCD_GetFont())->Height)*4, CurSamplStatus);
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief This function handles KEY1 interrupt request.
|
||||
* @param None
|
||||
|
|
Loading…
Reference in New Issue