请各位哥哥帮忙给回答一下c语言语法,着急中。。。。
#define max_pattern 6#define nb_module_MPHY 1
typedef struct
{
volatile uint *RegAddr; /* address of register */
uint RstVal; /* reset value */
uint TestVal; /* test value */
} tsModuleControlBusOff;
tsModuleControlBusOff MPHY_module [max_pattern] =
{
//eMACPHY Register Set TCU
{(volatile uint *) &T0_RUN_CTRL ,0x00000000, 0x00000001},
//CMEM_TCU register set.
{(volatile uint *) &TL_E2L , 0x00000000, 0x00000001},
//IDMA_CIP register
{(volatile uint *) &STRMCFG , 0x00000000, 0x00000001},
{(volatile uint *) &CIPCTRL , 0x00000000, 0x00000002},
//IDMA_COR register
{(volatile uint *) &CTRL , 0x00000000, 0x00000001},
//IDMA_RMI register
{(volatile uint *) &CCR , 0x00000000, 0x00000001},
};
tsModuleControlBusOff * MPHYModule [nb_module_MPHY] = {
MPHY_module
};
uint Errors = STD_OK;
uint i = 0;
uint j = 0;
uint tmp = 0;
uint nb_module_AHBx = 0;
/* enable module */
EnableModuleAHBx(AHBxPower);
switch (AHBxPower)
{
case MPHY_PowerState : nb_module_AHBx = nb_module_MPHY;
break;
/* bad choice */
default: return STD_ERR;
}
for (i = 0; i < nb_module_AHBx; i++)
{
for (j = 0; j < max_pattern; j++)
{
switch (AHBxPower)
{
case MPHY_PowerState : tmp = *(MPHYModule[i]->RegAddr); ------- position 2
if (tmp != MPHYModule[i]->RstVal) ------- position 3
Errors++;
MPHYModule[i]++; // MPHYModule[i]++ 是什么意思。。。。
break;
/* bad choice */
default: return STD_ERR;
}
}
问题:1)MPHYModule[i]++ 是什么意思。。。。,2)j循环再那里能体现出来。。。。3)position 2 and position 3 的MPHYModule 是指同一个吗?
小女子先谢了。。。。