
26 Jul
2019
26 Jul
'19
8:28 a.m.
Dear Chuanhua Han,
In message AM6PR04MB43572355560DF1349D6BC16097C10@AM6PR04MB4357.eurprd04.prod.outlook.com you wrote:
This is a really long list where you repeat the very same code again and again and again. Would it not make sense to declare a data array (holding pairs of <offset>, <data> entries), and then iterrate over the loop? The could would be much easier to read and also much smaller...
It seems feasible to use the array you mentioned, but some of the values to be set by i2c are obtained by index I /j in other arrays.
Yes, so what? You can write these values into your data array, too, right?
So we keep setting the i2c register in the same way as before.
Please don't. This code is ugly.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Physician: One upon whom we set our hopes when ill and our dogs when
well. - Ambrose Bierce