MCAL库里的ICU模块代码的疑似BUG
-
MCAL库中ICU代码中数组变量IcuWkupPortBuff的赋值似乎是错了。
ICU_CONST const uint16 IcuWkupPortBuff[ ICU_WKUP_PORT_MAX ] = { #if defined( YTM32B1MC_LQFP48 ) ( (uint16)( ICU_PORTA << 8U ) | 0U ), ( (uint16)( ICU_PORTA << 8U ) | 1U ), ( (uint16)( ICU_PORTA << 8U ) | 2U ), ( (uint16)( ICU_PORTA << 8U ) | 3U ), ( (uint16)( ICU_PORTA << 8U ) | 4U ), ( (uint16)( ICU_PORTA << 8U ) | 5U ), ( (uint16)( ICU_PORTA << 8U ) | 7U ), ( (uint16)( ICU_PORTA << 8U ) | 10U ), ( (uint16)( ICU_PORTA << 8U ) | 11U ), ( (uint16)( ICU_PORTA << 8U ) | 12U ), ( (uint16)( ICU_PORTA << 8U ) | 13U ), ( (uint16)( ICU_PORTB << 8U ) | 0 ), ( (uint16)( ICU_PORTB << 8U ) | 1U ), ( (uint16)( ICU_PORTB << 8U ) | 2U ), ( (uint16)( ICU_PORTB << 8U ) | 3U ), ( (uint16)( ICU_PORTB << 8U ) | 4U ), ( (uint16)( ICU_PORTB << 8U ) | 5U ), ( (uint16)( ICU_PORTB << 8U ) | 6U ), ( (uint16)( ICU_PORTB << 8U ) | 7U ), ( (uint16)( ICU_PORTB << 8U ) | 13U ), ( (uint16)( ICU_PORTC << 8U ) | 1U ), ( (uint16)( ICU_PORTC << 8U ) | 2U ), ( (uint16)( ICU_PORTC << 8U ) | 3U ), ( (uint16)( ICU_PORTC << 8U ) | 4U ), ( (uint16)( ICU_PORTC << 8U ) | 5U ), ( (uint16)( ICU_PORTC << 8U ) | 6U ), ( (uint16)( ICU_PORTC << 8U ) | 7U ), ( (uint16)( ICU_PORTC << 8U ) | 8U ), ( (uint16)( ICU_PORTC << 8U ) | 9U ), ( (uint16)( ICU_PORTC << 8U ) | 14U ), ( (uint16)( ICU_PORTC << 8U ) | 15U ), ( (uint16)( ICU_PORTC << 8U ) | 16U ), ( (uint16)( ICU_PORTD << 8U ) | 0U ), ( (uint16)( ICU_PORTD << 8U ) | 1U ), ( (uint16)( ICU_PORTD << 8U ) | 2U ), ( (uint16)( ICU_PORTD << 8U ) | 3U ), ( (uint16)( ICU_PORTD << 8U ) | 5U ), ( (uint16)( ICU_PORTD << 8U ) | 15U ), ( (uint16)( ICU_PORTD << 8U ) | 16U ), ( (uint16)( ICU_PORTE << 8U ) | 4U ), ( (uint16)( ICU_PORTE << 8U ) | 5U ), ( (uint16)( ICU_PORTE << 8U ) | 8U ), ( (uint16)( ICU_PORTE << 8U ) | 9U ), (uint16)0x0f00U /*0x0f00 is ACMP*/ #elif defined( YTM32B1MC_LQFP64 ) ( (uint16)( ICU_PORTA << 8U ) | 0U ), ( (uint16)( ICU_PORTA << 8U ) | 1U ), ( (uint16)( ICU_PORTA << 8U ) | 2U ), ( (uint16)( ICU_PORTA << 8U ) | 3U ), ( (uint16)( ICU_PORTA << 8U ) | 4U ), ( (uint16)( ICU_PORTA << 8U ) | 5U ), ( (uint16)( ICU_PORTA << 8U ) | 6U ), ( (uint16)( ICU_PORTA << 8U ) | 7U ), ( (uint16)( ICU_PORTA << 8U ) | 10U ), ( (uint16)( ICU_PORTA << 8U ) | 11U ), ( (uint16)( ICU_PORTA << 8U ) | 12U ), ( (uint16)( ICU_PORTA << 8U ) | 13U ), ( (uint16)( ICU_PORTB << 8U ) | 0 ), ( (uint16)( ICU_PORTB << 8U ) | 1U ), ( (uint16)( ICU_PORTB << 8U ) | 2U ), ( (uint16)( ICU_PORTB << 8U ) | 3U ), ( (uint16)( ICU_PORTB << 8U ) | 4U ), ( (uint16)( ICU_PORTB << 8U ) | 5U ), ( (uint16)( ICU_PORTB << 8U ) | 6U ), ( (uint16)( ICU_PORTB << 8U ) | 7U ), ( (uint16)( ICU_PORTB << 8U ) | 12U ), ( (uint16)( ICU_PORTB << 8U ) | 13U ), ( (uint16)( ICU_PORTC << 8U ) | 0 ), ( (uint16)( ICU_PORTC << 8U ) | 1U ), ( (uint16)( ICU_PORTC << 8U ) | 2U ), ( (uint16)( ICU_PORTC << 8U ) | 3U ), ( (uint16)( ICU_PORTC << 8U ) | 4U ), ( (uint16)( ICU_PORTC << 8U ) | 5U ), ( (uint16)( ICU_PORTC << 8U ) | 6U ), ( (uint16)( ICU_PORTC << 8U ) | 7U ), ( (uint16)( ICU_PORTC << 8U ) | 8U ), ( (uint16)( ICU_PORTC << 8U ) | 9U ), ( (uint16)( ICU_PORTC << 8U ) | 14U ), ( (uint16)( ICU_PORTC << 8U ) | 15U ), ( (uint16)( ICU_PORTC << 8U ) | 16U ), ( (uint16)( ICU_PORTC << 8U ) | 17U ), ( (uint16)( ICU_PORTD << 8U ) | 0U ), ( (uint16)( ICU_PORTD << 8U ) | 1U ), ( (uint16)( ICU_PORTD << 8U ) | 2U ), ( (uint16)( ICU_PORTD << 8U ) | 3U ), ( (uint16)( ICU_PORTD << 8U ) | 4U ), ( (uint16)( ICU_PORTD << 8U ) | 5U ), ( (uint16)( ICU_PORTD << 8U ) | 6U ), ( (uint16)( ICU_PORTD << 8U ) | 7U ), ( (uint16)( ICU_PORTD << 8U ) | 15U ), ( (uint16)( ICU_PORTD << 8U ) | 16U ), ( (uint16)( ICU_PORTE << 8U ) | 0U ), ( (uint16)( ICU_PORTE << 8U ) | 1U ), ( (uint16)( ICU_PORTE << 8U ) | 2U ), ( (uint16)( ICU_PORTE << 8U ) | 3U ), ( (uint16)( ICU_PORTE << 8U ) | 4U ), ( (uint16)( ICU_PORTE << 8U ) | 5U ), ( (uint16)( ICU_PORTE << 8U ) | 6U ), ( (uint16)( ICU_PORTE << 8U ) | 7U ), ( (uint16)( ICU_PORTE << 8U ) | 8U ), ( (uint16)( ICU_PORTE << 8U ) | 9U ), ( (uint16)( ICU_PORTE << 8U ) | 10U ), ( (uint16)( ICU_PORTE << 8U ) | 11U ), (uint16)0x0f00U /*0x0f00 is ACMP*/ #elif defined( CPU_YTM32B1ME0 ) ( (uint16)( ICU_PORTE << 8U ) | 11U ), ( (uint16)( ICU_PORTE << 8U ) | 10U ), ( (uint16)( ICU_PORTE << 8U ) | 5U ), ( (uint16)( ICU_PORTE << 8U ) | 4U ), ( (uint16)( ICU_PORTE << 8U ) | 3U ), ( (uint16)( ICU_PORTE << 8U ) | 1U ), ( (uint16)( ICU_PORTE << 8U ) | 0U ), ( (uint16)( ICU_PORTE << 8U ) | 9U ), ( (uint16)( ICU_PORTE << 8U ) | 8U ), ( (uint16)( ICU_PORTC << 8U ) | 3U ), ( (uint16)( ICU_PORTC << 8U ) | 2U ), ( (uint16)( ICU_PORTD << 8U ) | 5U ), ( (uint16)( ICU_PORTC << 8U ) | 1U ), ( (uint16)( ICU_PORTC << 8U ) | 0U ), ( (uint16)( ICU_PORTC << 8U ) | 15U ), ( (uint16)( ICU_PORTC << 8U ) | 14U ), ( (uint16)( ICU_PORTB << 8U ) | 1U ), ( (uint16)( ICU_PORTB << 8U ) | 0U ), ( (uint16)( ICU_PORTA << 8U ) | 7U ), ( (uint16)( ICU_PORTA << 8U ) | 6U ), ( (uint16)( ICU_PORTB << 8U ) | 13U ), ( (uint16)( ICU_PORTB << 8U ) | 12U ), ( (uint16)( ICU_PORTD << 8U ) | 3U ), ( (uint16)( ICU_PORTD << 8U ) | 2U ), ( (uint16)( ICU_PORTA << 8U ) | 3U ), ( (uint16)( ICU_PORTA << 8U ) | 2U ), ( (uint16)( ICU_PORTC << 8U ) | 7U ), ( (uint16)( ICU_PORTC << 8U ) | 6U ), ( (uint16)( ICU_PORTE << 8U ) | 6U ), ( (uint16)( ICU_PORTE << 8U ) | 2U ), ( (uint16)( ICU_PORTA << 8U ) | 13U ), ( (uint16)( ICU_PORTA << 8U ) | 12U ), (uint16)0x0f00U /*0x0f00 is ACMP*/ #elif defined( CPU_YTM32B1MD1 ) ( (uint16)( ICU_PORTE << 8U ) | 11U ), ( (uint16)( ICU_PORTE << 8U ) | 4U ), ( (uint16)( ICU_PORTE << 8U ) | 3U ), ( (uint16)( ICU_PORTE << 8U ) | 0U ), ( (uint16)( ICU_PORTE << 8U ) | 8U ), ( (uint16)( ICU_PORTC << 8U ) | 2U ), ( (uint16)( ICU_PORTC << 8U ) | 1U ), ( (uint16)( ICU_PORTC << 8U ) | 15U ), ( (uint16)( ICU_PORTB << 8U ) | 1U ), ( (uint16)( ICU_PORTA << 8U ) | 7U ), ( (uint16)( ICU_PORTB << 8U ) | 12U ), ( (uint16)( ICU_PORTD << 8U ) | 3U ), ( (uint16)( ICU_PORTA << 8U ) | 2U ), ( (uint16)( ICU_PORTC << 8U ) | 6U ), ( (uint16)( ICU_PORTE << 8U ) | 6U ), ( (uint16)( ICU_PORTA << 8U ) | 12U ), (uint16)0x0f00U #elif defined( CPU_YTM32B1HA0 ) ( (uint16)( ICU_PORTE << 8U ) | 11U ), ( (uint16)( ICU_PORTE << 8U ) | 10U ), ( (uint16)( ICU_PORTE << 8U ) | 5U ), ( (uint16)( ICU_PORTE << 8U ) | 4U ), ( (uint16)( ICU_PORTE << 8U ) | 3U ), ( (uint16)( ICU_PORTE << 8U ) | 1U ), ( (uint16)( ICU_PORTE << 8U ) | 0U ), ( (uint16)( ICU_PORTE << 8U ) | 9U ), ( (uint16)( ICU_PORTE << 8U ) | 8U ), ( (uint16)( ICU_PORTC << 8U ) | 3U ), ( (uint16)( ICU_PORTB << 8U ) | 26U ), ( (uint16)( ICU_PORTD << 8U ) | 5U ), ( (uint16)( ICU_PORTC << 8U ) | 1U ), ( (uint16)( ICU_PORTC << 8U ) | 0U ), ( (uint16)( ICU_PORTC << 8U ) | 15U ), ( (uint16)( ICU_PORTC << 8U ) | 14U ), ( (uint16)( ICU_PORTB << 8U ) | 1U ), ( (uint16)( ICU_PORTB << 8U ) | 0U ), ( (uint16)( ICU_PORTA << 8U ) | 7U ), ( (uint16)( ICU_PORTA << 8U ) | 6U ), ( (uint16)( ICU_PORTB << 8U ) | 13U ), ( (uint16)( ICU_PORTB << 8U ) | 12U ), ( (uint16)( ICU_PORTD << 8U ) | 3U ), ( (uint16)( ICU_PORTD << 8U ) | 2U ), ( (uint16)( ICU_PORTA << 8U ) | 3U ), ( (uint16)( ICU_PORTA << 8U ) | 2U ), ( (uint16)( ICU_PORTA << 8U ) | 13U ), // PTC7 ( (uint16)( ICU_PORTA << 8U ) | 12U ), // PTC6 ( (uint16)( ICU_PORTE << 8U ) | 16U ), // PTE6 ( (uint16)( ICU_PORTE << 8U ) | 15 ), // PTE2 ( (uint16)( ICU_PORTE << 8U ) | 14U ), // PTA13 ( (uint16)( ICU_PORTE << 8U ) | 13U ), // PTA12 ( (uint16)( ICU_PORTE << 8U ) | 12U ), // PTE16 ( (uint16)( ICU_PORTE << 8U ) | 2U ), // PTE15 ( (uint16)( ICU_PORTA << 8U ) | 22U ), ( (uint16)( ICU_PORTE << 8U ) | 14U ), ( (uint16)( ICU_PORTD << 8U ) | 15U ), ( (uint16)( ICU_PORTD << 8U ) | 13U ), ( (uint16)( ICU_PORTB << 8U ) | 21U ), ( (uint16)( ICU_PORTB << 8U ) | 23U ), ( (uint16)( ICU_PORTB << 8U ) | 25U ), // PTB2 ( (uint16)( ICU_PORTC << 8U ) | 25U ), // PTC25 ( (uint16)( ICU_PORTC << 8U ) | 11U ), ( (uint16)( ICU_PORTC << 8U ) | 9U ), ( (uint16)( ICU_PORTB << 8U ) | 17U ), ( (uint16)( ICU_PORTD << 8U ) | 4U ), ( (uint16)( ICU_PORTB << 8U ) | 9U ), ( (uint16)( ICU_PORTB << 8U ) | 8U ), ( (uint16)( ICU_PORTA << 8U ) | 15U ), ( (uint16)( ICU_PORTE << 8U ) | 23U ), ( (uint16)( ICU_PORTE << 8U ) | 25U ), ( (uint16)( ICU_PORTA << 9U ) | 8U ), // PTA9 ( (uint16)( ICU_PORTA << 8U ) | 8U ), ( (uint16)( ICU_PORTB << 8U ) | 16U ), ( (uint16)( ICU_PORTB << 8U ) | 15U ), ( (uint16)( ICU_PORTA << 8U ) | 1U ), ( (uint16)( ICU_PORTA << 8U ) | 16U ), ( (uint16)( ICU_PORTA << 8U ) | 25U ), ( (uint16)( ICU_PORTA << 8U ) | 30U ), ( (uint16)( ICU_PORTB << 8U ) | 28U ), ( (uint16)( ICU_PORTC << 8U ) | 18U ), ( (uint16)( ICU_PORTA << 8U ) | 26U ), ( (uint16)( ICU_PORTC << 8U ) | 23U ), ( (uint16)( ICU_PORTB << 8U ) | 11U ), (uint16)0x0f00U /*0x0f00 is ACMP*/ #endif };
有部分定义跟规格书上写的对不上,里面( (uint16)( ICU_PORTA << 9U ) | 8U ),看着就是移位操作错了。
发帖前请查看
帮助没办法联网的电脑使用YCT
帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...