mirror of
https://gitee.com/seekfree/TC264_Library.git
synced 2026-06-04 03:32:56 +00:00
V1.0.7
修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 对部分代码加入#pragma warning,避免提高优化等级时出现警告 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码
This commit is contained in:
@@ -164,13 +164,15 @@
|
||||
<option id="com.tasking.ctc.cc.optimize.775309643" name="Optimization level:" superClass="com.tasking.ctc.cc.optimize" value="com.tasking.ctc.cc.optimize.0" valueType="enumerated"/>
|
||||
<option id="com.tasking.ctc.cc.tradeoff.53559744" name="Trade-off between speed and size:" superClass="com.tasking.ctc.cc.tradeoff" value="com.tasking.ctc.cc.tradeoff.0" valueType="enumerated"/>
|
||||
<option id="com.tasking.ctc.cc.definedSymbols.1587155176" name="Defined symbols" superClass="com.tasking.ctc.cc.definedSymbols"/>
|
||||
<option id="com.tasking.ctc.cc.nowarning.1511282323" superClass="com.tasking.ctc.cc.nowarning" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="W557"/>
|
||||
</option>
|
||||
<inputType id="com.tasking.ctc.cppInputType.1272022268" name="C++" superClass="com.tasking.ctc.cppInputType"/>
|
||||
<inputType id="com.tasking.ctc.cpp.cInputType.69092563" name="C" superClass="com.tasking.ctc.cpp.cInputType"/>
|
||||
<inputType id="com.tasking.ctc.cc.msInputType.1535524086" name="MS" superClass="com.tasking.ctc.cc.msInputType"/>
|
||||
</tool>
|
||||
<tool id="com.tasking.ctc.as.abs.debug.1390239146" name="Assembler" superClass="com.tasking.ctc.as.abs.debug">
|
||||
<option id="com.tasking.ctc.as.includePaths.1708708624" name="Include paths" superClass="com.tasking.ctc.as.includePaths" valueType="includePath">
|
||||
</option>
|
||||
<option id="com.tasking.ctc.as.includePaths.1708708624" name="Include paths" superClass="com.tasking.ctc.as.includePaths"/>
|
||||
<inputType id="com.tasking.ctc.asmInputType.1471959711" name="ASM" superClass="com.tasking.ctc.asmInputType"/>
|
||||
</tool>
|
||||
<tool id="com.tasking.ctc.lk.abs.debug.1142239087" name="Linker" superClass="com.tasking.ctc.lk.abs.debug">
|
||||
|
||||
@@ -183,13 +183,14 @@ void Ifx_AngleTrkF32_init(Ifx_AngleTrkF32 *aObsv, const Ifx_AngleTrkF32_Config *
|
||||
aObsv->cfgData.sqrAmplMin = config->sqrAmplMin;
|
||||
aObsv->sinIn = config->sinIn;
|
||||
aObsv->cosIn = config->cosIn;
|
||||
#pragma warning 549
|
||||
|
||||
if (!__neqf(config->kp, 0) && !__neqf(config->ki, 0) && !__neqf(config->kp, 0))
|
||||
{ /* all gains are zero, use default */
|
||||
/* FIXME might not be requied as set by Ifx_AngleTrkF32_initConfig() */
|
||||
Ifx_AngleTrkF32_setControlGains(&aObsv->cfgData, ATO_K, ATO_T, ATO_PSI);
|
||||
}
|
||||
|
||||
#pragma warning default
|
||||
Ifx_AngleTrkF32_setUserSampling(aObsv, Ts);
|
||||
aObsv->angleErr = 0.0F;
|
||||
aObsv->angleEst = 0.0F;
|
||||
|
||||
@@ -335,6 +335,7 @@ uint32 Ifx_Crc_table(Ifc_Crc *driver, uint8 *p, uint32 len)
|
||||
crc = ((crc >> 8) | (*p++ << (orderMinusHeight))) ^ crctab[crc & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma warning 529
|
||||
|
||||
if (!driver->table->refin)
|
||||
{
|
||||
@@ -350,6 +351,7 @@ uint32 Ifx_Crc_table(Ifc_Crc *driver, uint8 *p, uint32 len)
|
||||
crc = (crc >> 8) ^ crctab[crc & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma warning default
|
||||
}
|
||||
else if (driver->table->order <= 16)
|
||||
{
|
||||
@@ -369,6 +371,7 @@ uint32 Ifx_Crc_table(Ifc_Crc *driver, uint8 *p, uint32 len)
|
||||
crc = ((crc >> 8) | (*p++ << (orderMinusHeight))) ^ crctab[crc & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma warning 529
|
||||
|
||||
if (!driver->table->refin)
|
||||
{
|
||||
@@ -384,6 +387,7 @@ uint32 Ifx_Crc_table(Ifc_Crc *driver, uint8 *p, uint32 len)
|
||||
crc = (crc >> 8) ^ crctab[crc & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma warning default
|
||||
}
|
||||
else if (driver->table->order <= 32)
|
||||
{
|
||||
@@ -403,6 +407,7 @@ uint32 Ifx_Crc_table(Ifc_Crc *driver, uint8 *p, uint32 len)
|
||||
crc = ((crc >> 8) | (*p++ << (orderMinusHeight))) ^ crctab[crc & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma warning 529
|
||||
|
||||
if (!driver->table->refin)
|
||||
{
|
||||
@@ -418,6 +423,7 @@ uint32 Ifx_Crc_table(Ifc_Crc *driver, uint8 *p, uint32 len)
|
||||
crc = (crc >> 8) ^ crctab[crc & 0xff];
|
||||
}
|
||||
}
|
||||
#pragma warning default
|
||||
}
|
||||
|
||||
if (driver->refout ^ driver->table->refin)
|
||||
|
||||
@@ -55,7 +55,9 @@ sint16 Ifx_g_LutAtan2F32_FxpAngle_table[IFX_LUTATAN2F32_SIZE];
|
||||
#endif
|
||||
|
||||
const Ifx_Lut_FxpAngle Ifx_g_LutAtan2F32_FxpAngle_table[1024 + 1] = {
|
||||
0,//IFX_LUT_F32_TO_FXPANGLE(0),<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD>
|
||||
#pragma warning 587
|
||||
IFX_LUT_F32_TO_FXPANGLE(0),
|
||||
#pragma warning default
|
||||
IFX_LUT_F32_TO_FXPANGLE(0.000976562189559319),
|
||||
IFX_LUT_F32_TO_FXPANGLE(0.00195312251647882),
|
||||
IFX_LUT_F32_TO_FXPANGLE(0.00292967911813999),
|
||||
@@ -1081,6 +1083,7 @@ const Ifx_Lut_FxpAngle Ifx_g_LutAtan2F32_FxpAngle_table[1024 + 1] = {
|
||||
IFX_LUT_F32_TO_FXPANGLE(0.784909643651259),
|
||||
IFX_LUT_F32_TO_FXPANGLE(0.785398163397448),
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
const float32 Ifx_g_LutAtan2F32_table[IFX_LUTATAN2F32_SIZE + 1] =
|
||||
|
||||
@@ -359,8 +359,10 @@ IFX_STATIC boolean IfxDsadc_Rdc_initHwChannels(IfxDsadc_Rdc *driver, const IfxDs
|
||||
{
|
||||
srcr = &MODULE_SRC.DSADC.DSADC3.SRM;
|
||||
}
|
||||
#pragma warning 507
|
||||
|
||||
IfxSrc_init(srcr, configHw->servReqProvider, configHw->servReqPriority);
|
||||
#pragma warning default
|
||||
IfxSrc_enable(srcr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,6 +285,7 @@ boolean IfxGtm_Trig_toSent(Ifx_GTM *gtm, IfxGtm_Trig_SentGroup sentGroup, IfxGtm
|
||||
{
|
||||
config = table->trigger[sentTrig].source[source].channel[channel].config;
|
||||
result = config != 0xFF;
|
||||
#pragma warning 547
|
||||
|
||||
if ((sentGroup / 6) == 0) // write to VADC registers
|
||||
{
|
||||
@@ -306,6 +307,7 @@ boolean IfxGtm_Trig_toSent(Ifx_GTM *gtm, IfxGtm_Trig_SentGroup sentGroup, IfxGtm
|
||||
{
|
||||
__ldmst_c(&(gtm->INOUTSEL.DSADC.OUTSEL00.U), mask, value);
|
||||
}
|
||||
#pragma warning default
|
||||
}
|
||||
|
||||
IFX_ASSERT(IFX_VERBOSE_LEVEL_ERROR, result);
|
||||
|
||||
@@ -54,4 +54,9 @@ V1.0.5
|
||||
|
||||
V1.0.6
|
||||
<09><><EFBFBD><EFBFBD>ADC<44><43><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>õĺ궨<C4BA>壬ADC_SAMPLE_FREQUENCY<43><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ10Mhz<68><7A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD>µ<EFBFBD><C2B5>ٶ<EFBFBD><D9B6>нϴ<D0BD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
V1.0.7
|
||||
<09><EFBFBD>ʹ<EFBFBD><CAB9>systick_getval<61><6C>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<CAB1>䳬<EFBFBD><E4B3AC>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⡣
|
||||
<09>Բ<EFBFBD><D4B2>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#pragma warning<6E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD><C5BB>ȼ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>־<EFBFBD><D6BE><EFBFBD>
|
||||
<09><EFBFBD>1.8<EFBFBD><EFBFBD>TFT<EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>ֵĴ<EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
@@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function)
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>Ŀ¼ <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD> <20><><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("ASSERTION: %s %d %s\n",__file, __line, __function);
|
||||
#pragma warning 507
|
||||
while(TRUE)
|
||||
{
|
||||
//<2F>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD> <20><><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>
|
||||
|
||||
}
|
||||
#pragma warning default
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ void pit_init(CCU6N_enum ccu6n, CCU6_CHN_enum pit_ch, uint32 time)
|
||||
timer_period = (uint32)(timer_input_clk * time / 1000000);
|
||||
if(timer_period < 0xffff) break;
|
||||
timer_input_clk >>= 1;
|
||||
i++;
|
||||
}
|
||||
if(16 <= i) IFX_ASSERT(IFX_VERBOSE_LEVEL_ERROR, FALSE);
|
||||
|
||||
|
||||
@@ -144,7 +144,9 @@ void eru_init(ERU_PIN_enum eru_pin, TRIGGER_enum trigger)
|
||||
}break;
|
||||
|
||||
}
|
||||
#pragma warning 507
|
||||
IfxSrc_init(src, eru_service, eru_priority);
|
||||
#pragma warning default
|
||||
IfxSrc_enable(src);
|
||||
|
||||
restoreInterrupts(interrupt_state);
|
||||
|
||||
@@ -49,7 +49,9 @@ volatile Ifx_P* get_port(PIN_enum pin)
|
||||
case P33_0: port = &MODULE_P33; break;
|
||||
default:break;
|
||||
}
|
||||
#pragma warning 507
|
||||
return port;
|
||||
#pragma warning default
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -83,8 +83,10 @@ void gpt12_mux(GPTN_enum gptn, GPT_PIN_enum count_pin, GPT_PIN_enum dir_pin)
|
||||
else ZF_ASSERT(FALSE);
|
||||
}break;
|
||||
}
|
||||
#pragma warning 507
|
||||
IfxGpt12_initTxInPinWithPadLevel(count, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1);
|
||||
IfxGpt12_initTxEudInPinWithPadLevel(dir, IfxPort_InputMode_pullUp, IfxPort_PadDriver_cmosAutomotiveSpeed1);
|
||||
#pragma warning default
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn)
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// @brief <20><><EFBFBD>õ<EFBFBD>ǰSystem tick timer<65><72>ֵ
|
||||
// @param stmn ѡ<><D1A1>ʹ<EFBFBD>õ<EFBFBD>ģ<EFBFBD><C4A3>
|
||||
// @return uint32 <09><><EFBFBD>شӿ<D8B4>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
// @return uint32 <09><><EFBFBD>شӿ<D8B4>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ʱ<EFBFBD><CAB1>(<28><>λ10ns)
|
||||
// Sample usage: uint32 tim = systick_getval(STM0);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
uint32 systick_getval(STMN_enum stmn)
|
||||
@@ -65,6 +65,6 @@ uint32 systick_getval(STMN_enum stmn)
|
||||
stm_clk = IfxStm_getFrequency(IfxStm_getAddress((IfxStm_Index)stmn));
|
||||
|
||||
time = IfxStm_getLower(IfxStm_getAddress((IfxStm_Index)stmn)) - systick_count[stmn];
|
||||
time = (uint32)((uint64)time * 1000000000 / stm_clk);
|
||||
time = (uint32)((uint64)time * 100000000 / stm_clk);
|
||||
return time;
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn);
|
||||
#define systick_delay_ns(stmn, time) systick_delay(stmn, time) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<CAB1><CAB1> <20><>λns
|
||||
|
||||
//------------------------------------<2D><><EFBFBD>º궨<C2BA><EAB6A8><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1>ǰʱ<C7B0><CAB1>------------------------------------
|
||||
#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λms
|
||||
#define systick_getval_us(stmn) systick_getval(stmn)/1000 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λus
|
||||
#define systick_getval_ns(stmn) systick_getval(stmn) //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λns
|
||||
#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λms
|
||||
#define systick_getval_us(stmn) systick_getval(stmn)/100 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λus
|
||||
#define systick_getval_ns(stmn) systick_getval(stmn)*10 //<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ʱʱ<CAB1><CAB1> <20><>λns
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -201,13 +201,11 @@ void lcd_init(void)
|
||||
lcd_writeData(0x0E);
|
||||
|
||||
lcd_writeIndex(0x36);
|
||||
switch(TFT_DISPLAY_DIR)//y x v
|
||||
{
|
||||
case 0: lcd_writeData(1<<7 | 1<<6 | 0<<5); break; //<2F><><EFBFBD><EFBFBD>ģʽ
|
||||
case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //<2F><><EFBFBD><EFBFBD>ģʽ <20><>ת180
|
||||
case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //<2F><><EFBFBD><EFBFBD>ģʽ
|
||||
case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //<2F><><EFBFBD><EFBFBD>ģʽ <20><>ת180
|
||||
}
|
||||
|
||||
if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //<2F><><EFBFBD><EFBFBD>ģʽ
|
||||
else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //<2F><><EFBFBD><EFBFBD>ģʽ <20><>ת180
|
||||
else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //<2F><><EFBFBD><EFBFBD>ģʽ
|
||||
else lcd_writeData(0<<7 | 1<<6 | 1<<5); //<2F><><EFBFBD><EFBFBD>ģʽ <20><>ת180
|
||||
|
||||
lcd_writeIndex(0xe0);
|
||||
lcd_writeData(0x0f);
|
||||
|
||||
@@ -108,10 +108,10 @@ void ips114_init(void)
|
||||
|
||||
ips114_writeIndex(0x36);
|
||||
|
||||
if (IPS114_DISPLAY_DIR==0) ips114_writeData(0x00);
|
||||
else if (IPS114_DISPLAY_DIR==1) ips114_writeData(0xC0);
|
||||
else if (IPS114_DISPLAY_DIR==2) ips114_writeData(0x70);
|
||||
else ips114_writeData(0xA0);
|
||||
if (IPS114_DISPLAY_DIR==0) ips114_writeData(0x00);
|
||||
else if (IPS114_DISPLAY_DIR==1) ips114_writeData(0xC0);
|
||||
else if (IPS114_DISPLAY_DIR==2) ips114_writeData(0x70);
|
||||
else ips114_writeData(0xA0);
|
||||
|
||||
ips114_writeIndex(0x3A);
|
||||
ips114_writeData(0x05);
|
||||
|
||||
@@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value)
|
||||
for(j=0; j<width; j++)
|
||||
{
|
||||
dat = 0;
|
||||
if( i<(temp-1) || !temp1 || temp1>=1)dat |= (*(p+i*8*width+j+width*0) > value? 1: 0)<<0;
|
||||
dat |= (*(p+i*8*width+j+width*0) > value? 1: 0)<<0;
|
||||
if( i<(temp-1) || !temp1 || temp1>=2)dat |= (*(p+i*8*width+j+width*1) > value? 1: 0)<<1;
|
||||
if( i<(temp-1) || !temp1 || temp1>=3)dat |= (*(p+i*8*width+j+width*2) > value? 1: 0)<<2;
|
||||
if( i<(temp-1) || !temp1 || temp1>=4)dat |= (*(p+i*8*width+j+width*3) > value? 1: 0)<<3;
|
||||
|
||||
Reference in New Issue
Block a user