--avalon8-freq Set Avalon8 default frequency, range:[25, 1200], step: 25, example: 800
--avalon8-freq-selSet Avalon8 default frequency select, range:[0, 3], step: 1, example: 3 (default: 3)
char *set_avalon8_freq(char *arg)
{
int val[AVA8_DEFAULT_PLL_CNT];
char *colon, *data;
int i;
if (!(*arg))
return NULL;
data = arg;
memset(val, 0, sizeof(val));
for (i = 0; i < AVA8_DEFAULT_PLL_CNT; i++) {
colon = strchr(data, ':');
if (colon)
*(colon++) = '\0';
else {
/* last value */
if (*data) {
val[i] = atoi(data);
if (val[i] > AVA8_DEFAULT_FREQUENCY_MAX)
return "Invalid value passed to avalon8-freq";
}
break;
}
if (*data) {
val[i] = atoi(data);
if (val[i] > AVA8_DEFAULT_FREQUENCY_MAX)
return "Invalid value passed to avalon8-freq";
}
data = colon;
}
for (i = 0; i < AVA8_DEFAULT_PLL_CNT; i++)
opt_avalon8_freq[i] = val[i];
return NULL;
}
I'm so confused, can you give me some clue? Thank you.