diff --git a/Example/1-ADC_Demo/.cproject b/Example/1-ADC_Demo/.cproject index f2ed525..2aef693 100644 --- a/Example/1-ADC_Demo/.cproject +++ b/Example/1-ADC_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/1-ADC_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/1-ADC_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/1-ADC_Demo/Libraries/doc/version.txt b/Example/1-ADC_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/1-ADC_Demo/Libraries/doc/version.txt +++ b/Example/1-ADC_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/1-ADC_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/10-Interrupt_Priority_Set_Demo/.cproject b/Example/10-Interrupt_Priority_Set_Demo/.cproject index aec7b98..51e7d51 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/.cproject +++ b/Example/10-Interrupt_Priority_Set_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt b/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/11-Systick_Demo/.cproject b/Example/11-Systick_Demo/.cproject index de2ce9f..fb0daa2 100644 --- a/Example/11-Systick_Demo/.cproject +++ b/Example/11-Systick_Demo/.cproject @@ -164,13 +164,15 @@ - + @@ -185,7 +187,11 @@ + TASKING VX-toolset for TriCore: control program v6.3r1 Build 19041558 + TASKING VX-toolset for TriCore: object linker v6.3r1 Build 19041558 + TASKING VX-toolset for TriCore: assembler v6.3r1 Build 19041558 TASKING program builder v6.3r1 Build 19041558 + TASKING VX-toolset for TriCore: C compiler v6.3r1 Build 19041558 diff --git a/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/11-Systick_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/11-Systick_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/11-Systick_Demo/Libraries/doc/version.txt b/Example/11-Systick_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/11-Systick_Demo/Libraries/doc/version.txt +++ b/Example/11-Systick_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/11-Systick_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/12-Dual_Core_Demo/.cproject b/Example/12-Dual_Core_Demo/.cproject index 9ecc9bc..2ae8aad 100644 --- a/Example/12-Dual_Core_Demo/.cproject +++ b/Example/12-Dual_Core_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/12-Dual_Core_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/12-Dual_Core_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/12-Dual_Core_Demo/Libraries/doc/version.txt b/Example/12-Dual_Core_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/12-Dual_Core_Demo/Libraries/doc/version.txt +++ b/Example/12-Dual_Core_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/13-FFT_Demo/.cproject b/Example/13-FFT_Demo/.cproject index d8d4814..a3bc676 100644 --- a/Example/13-FFT_Demo/.cproject +++ b/Example/13-FFT_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/13-FFT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/13-FFT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/13-FFT_Demo/Libraries/doc/version.txt b/Example/13-FFT_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/13-FFT_Demo/Libraries/doc/version.txt +++ b/Example/13-FFT_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/13-FFT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/13-FFT_Demo/USER/Cpu0_Main.c b/Example/13-FFT_Demo/USER/Cpu0_Main.c index 72e7c13..7491622 100644 --- a/Example/13-FFT_Demo/USER/Cpu0_Main.c +++ b/Example/13-FFT_Demo/USER/Cpu0_Main.c @@ -62,6 +62,7 @@ int core0_main(void) { systick_start(STM0); //开始计时 Ifx_FftF32_radix2(fft_out, fft_in, SIZE_N); //进行FFT运算 + //Ifx_FftF32_radix2I 为IFT(FFT逆变换)运算 use_time = systick_getval_us(STM0); //获取计时时间 printf("use_time: %ldus\n", use_time); //打印fft一次耗时多久 diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/.cproject b/Example/14-Specifies_Variable_Or_Code_Location_Demo/.cproject index 57c8be0..f3c1b52 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/.cproject +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/2-LED_Blink_Demo/.cproject b/Example/2-LED_Blink_Demo/.cproject index 7a60877..f42197a 100644 --- a/Example/2-LED_Blink_Demo/.cproject +++ b/Example/2-LED_Blink_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/2-LED_Blink_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/2-LED_Blink_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/2-LED_Blink_Demo/Libraries/doc/version.txt b/Example/2-LED_Blink_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/2-LED_Blink_Demo/Libraries/doc/version.txt +++ b/Example/2-LED_Blink_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/3-PIT_Demo/.cproject b/Example/3-PIT_Demo/.cproject index 58c81f9..e9f1335 100644 --- a/Example/3-PIT_Demo/.cproject +++ b/Example/3-PIT_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/3-PIT_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/3-PIT_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/3-PIT_Demo/Libraries/doc/version.txt b/Example/3-PIT_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/3-PIT_Demo/Libraries/doc/version.txt +++ b/Example/3-PIT_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/3-PIT_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/4-Encoder_Demo/.cproject b/Example/4-Encoder_Demo/.cproject index c3a5dd5..adbc1fb 100644 --- a/Example/4-Encoder_Demo/.cproject +++ b/Example/4-Encoder_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/4-Encoder_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/4-Encoder_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/4-Encoder_Demo/Libraries/doc/version.txt b/Example/4-Encoder_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/4-Encoder_Demo/Libraries/doc/version.txt +++ b/Example/4-Encoder_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/4-Encoder_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/5-UART_Demo/.cproject b/Example/5-UART_Demo/.cproject index 85df14b..0119d96 100644 --- a/Example/5-UART_Demo/.cproject +++ b/Example/5-UART_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/5-UART_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/5-UART_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/5-UART_Demo/Libraries/doc/version.txt b/Example/5-UART_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/5-UART_Demo/Libraries/doc/version.txt +++ b/Example/5-UART_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/5-UART_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/6-Printf_Demo/.cproject b/Example/6-Printf_Demo/.cproject index 8ad8fda..515f5e4 100644 --- a/Example/6-Printf_Demo/.cproject +++ b/Example/6-Printf_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/6-Printf_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/6-Printf_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/6-Printf_Demo/Libraries/doc/version.txt b/Example/6-Printf_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/6-Printf_Demo/Libraries/doc/version.txt +++ b/Example/6-Printf_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/6-Printf_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/7-GPIO_Interrupt_Demo/.cproject b/Example/7-GPIO_Interrupt_Demo/.cproject index 159920b..0d22c5e 100644 --- a/Example/7-GPIO_Interrupt_Demo/.cproject +++ b/Example/7-GPIO_Interrupt_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt b/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/8-EEPROM_Demo/.cproject b/Example/8-EEPROM_Demo/.cproject index e4b6e1e..07fa34f 100644 --- a/Example/8-EEPROM_Demo/.cproject +++ b/Example/8-EEPROM_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/8-EEPROM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/8-EEPROM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/8-EEPROM_Demo/Libraries/doc/version.txt b/Example/8-EEPROM_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/8-EEPROM_Demo/Libraries/doc/version.txt +++ b/Example/8-EEPROM_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/8-EEPROM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Example/9-PWM_Demo/.cproject b/Example/9-PWM_Demo/.cproject index b9c6ab0..94479d9 100644 --- a/Example/9-PWM_Demo/.cproject +++ b/Example/9-PWM_Demo/.cproject @@ -164,13 +164,15 @@ - + diff --git a/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Example/9-PWM_Demo/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Example/9-PWM_Demo/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Example/9-PWM_Demo/Libraries/doc/version.txt b/Example/9-PWM_Demo/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Example/9-PWM_Demo/Libraries/doc/version.txt +++ b/Example/9-PWM_Demo/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/zf_assert.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_eru.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_eru.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpio.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpio.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpt12.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Example/9-PWM_Demo/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Seekfree_TC264_Opensource_Library/.cproject b/Seekfree_TC264_Opensource_Library/.cproject index 3e65b25..c7e8979 100644 --- a/Seekfree_TC264_Opensource_Library/.cproject +++ b/Seekfree_TC264_Opensource_Library/.cproject @@ -164,6 +164,9 @@ @@ -188,7 +191,11 @@ + TASKING VX-toolset for TriCore: control program v6.3r1 Build 19041558 + TASKING VX-toolset for TriCore: object linker v6.3r1 Build 19041558 + TASKING VX-toolset for TriCore: assembler v6.3r1 Build 19041558 TASKING program builder v6.3r1 Build 19041558 + TASKING VX-toolset for TriCore: C compiler v6.3r1 Build 19041558 diff --git a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c index 4274403..17665af 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_AngleTrkF32.c @@ -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; diff --git a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c index 748021e..688c04c 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_Crc.c @@ -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) diff --git a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c index 24bd235..c7f5da3 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/Service/CpuGeneric/SysSe/Math/Ifx_LutAtan2F32_Table.c @@ -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),避免出现警告 +#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] = diff --git a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c index a102cc6..a8dda14 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Dsadc/Rdc/IfxDsadc_Rdc.c @@ -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); } } diff --git a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c index 01d628b..deaa5d7 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/BaseSw/iLLD/TC26B/Tricore/Gtm/Trig/IfxGtm_Trig.c @@ -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); diff --git a/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt b/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt index 6c8ebe1..bb8abf2 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt +++ b/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt @@ -54,4 +54,9 @@ V1.0.5 V1.0.6 增加ADC采样频率设置的宏定义,ADC_SAMPLE_FREQUENCY,最大允许设置为10Mhz,相比默认下的速度有较大的提升 + +V1.0.7 + 修复使用systick_getval计时,当计时时间超过4秒左右会出现时间测量错误的问题。 + 对部分代码加入#pragma warning,避免提高优化等级时出现警告 + 修改1.8寸TFT屏幕初始化中关于屏幕方向选择部分的代码 \ No newline at end of file diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/common/zf_assert.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/common/zf_assert.c index edef4e7..df563e4 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/common/zf_assert.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/common/zf_assert.c @@ -24,9 +24,11 @@ void assert(pchar __file, unsigned int __line, pchar __function) { //输出断言错误 所在文件目录 所在文件行 调用函数名称 printf("ASSERTION: %s %d %s\n",__file, __line, __function); +#pragma warning 507 while(TRUE) { //等待程序员解决 断言错误 } +#pragma warning default } diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_ccu6_pit.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_ccu6_pit.c index bb17f09..e81100f 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_ccu6_pit.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_ccu6_pit.c @@ -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); diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_eru.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_eru.c index dc0a512..6c2aba4 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_eru.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_eru.c @@ -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); diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpio.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpio.c index 9946091..8076e5c 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpio.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpio.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpt12.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpt12.c index a564a15..eb0d71c 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpt12.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gpt12.c @@ -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 } //------------------------------------------------------------------------------------------------------------------- diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.c index 3c3ec77..28dff69 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.c @@ -54,7 +54,7 @@ void systick_start(STMN_enum stmn) //------------------------------------------------------------------------------------------------------------------- // @brief 获得当前System tick timer的值 // @param stmn 选择使用的模块 -// @return uint32 返回从开始到现在的时间 +// @return uint32 返回从开始到现在的时间(单位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; } diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.h b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.h index 64bc210..5e570c7 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.h +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_stm_systick.h @@ -41,9 +41,9 @@ uint32 systick_getval(STMN_enum stmn); #define systick_delay_ns(stmn, time) systick_delay(stmn, time) //设置延时时间 单位ns //------------------------------------以下宏定义用于获取当前时间------------------------------------ -#define systick_getval_ms(stmn) systick_getval(stmn)/1000000 //获取当前计时时间 单位ms -#define systick_getval_us(stmn) systick_getval(stmn)/1000 //获取当前计时时间 单位us -#define systick_getval_ns(stmn) systick_getval(stmn) //获取当前计时时间 单位ns +#define systick_getval_ms(stmn) systick_getval(stmn)/100000 //获取当前计时时间 单位ms +#define systick_getval_us(stmn) systick_getval(stmn)/100 //获取当前计时时间 单位us +#define systick_getval_ns(stmn) systick_getval(stmn)*10 //获取当前计时时间 单位ns #endif diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c index 081950d..e091914 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_18TFT.c @@ -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; //竖屏模式 - case 1: lcd_writeData(0<<7 | 0<<6 | 0<<5); break; //竖屏模式 旋转180 - case 2: lcd_writeData(1<<7 | 0<<6 | 1<<5); break; //横屏模式 - case 3: lcd_writeData(0<<7 | 1<<6 | 1<<5); break; //横屏模式 旋转180 - } + + if (TFT_DISPLAY_DIR==0) lcd_writeData(1<<7 | 1<<6 | 0<<5); //竖屏模式 + else if (TFT_DISPLAY_DIR==1) lcd_writeData(0<<7 | 0<<6 | 0<<5); //竖屏模式 旋转180 + else if (TFT_DISPLAY_DIR==2) lcd_writeData(1<<7 | 0<<6 | 1<<5); //横屏模式 + else lcd_writeData(0<<7 | 1<<6 | 1<<5); //横屏模式 旋转180 lcd_writeIndex(0xe0); lcd_writeData(0x0f); diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c index d39eb87..4a91726 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_IPS114_SPI.c @@ -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); diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_OLED.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_OLED.c index 1aaa111..0af117b 100644 --- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_OLED.c +++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_peripheral/SEEKFREE_OLED.c @@ -485,7 +485,7 @@ void oled_dis_bmp(uint16 high, uint16 width, uint8 *p,uint8 value) for(j=0; j=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; diff --git a/Seekfree_TC264_Opensource_Library/USER/Cpu0_Main.c b/Seekfree_TC264_Opensource_Library/USER/Cpu0_Main.c index 4b8ef0e..4d9056b 100644 --- a/Seekfree_TC264_Opensource_Library/USER/Cpu0_Main.c +++ b/Seekfree_TC264_Opensource_Library/USER/Cpu0_Main.c @@ -23,6 +23,12 @@ //将本语句与#pragma section all restore语句之间的全局变量都放在CPU0的RAM中 +//工程导入到软件之后,应该选中工程然后点击refresh刷新一下之后再编译 +//工程默认设置为关闭优化,可以自己右击工程选择properties->C/C++ Build->Setting +//然后在右侧的窗口中找到C/C++ Compiler->Optimization->Optimization level处设置优化等级 +//一般默认新建立的工程都会默认开2级优化,因此大家也可以设置为2级优化 + + int core0_main(void) { get_clk();//获取时钟频率 务必保留