Implement Silicom card features #1
1 changed files with 3 additions and 3 deletions
|
@ -5532,8 +5532,8 @@ fm_status fmPlatformLibSetVrmVoltage(fm_int sw,
|
||||||
{
|
{
|
||||||
printf("vrm mVolt %d delta %d\n", mVolt, hwResId->vrm.delta);
|
printf("vrm mVolt %d delta %d\n", mVolt, hwResId->vrm.delta);
|
||||||
uint voltageCalc = (mVolt + hwResId->vrm.delta) / 5 - 49;
|
uint voltageCalc = (mVolt + hwResId->vrm.delta) / 5 - 49;
|
||||||
data[1] = (char) voltageCalc;
|
data[1] = voltageCalc;
|
||||||
printf("vrm channel %d data 0x%x\n", channel, voltageCalc & 0xff);
|
printf("vrm channel %d data 0x%x\n", channel, voltageCalc);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
if(channel == 0){
|
if(channel == 0){
|
||||||
|
@ -5542,7 +5542,7 @@ fm_status fmPlatformLibSetVrmVoltage(fm_int sw,
|
||||||
data[0] = 0x27;
|
data[0] = 0x27;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(uint i; i < 0x32; ++i){
|
for(uint i = 0; i < 0x32; ++i){
|
||||||
status = i2c->writeReadFunc(i2c->handle, vrmI2c->addr, data, 2, 0);
|
status = i2c->writeReadFunc(i2c->handle, vrmI2c->addr, data, 2, 0);
|
||||||
if(status == FM_OK){
|
if(status == FM_OK){
|
||||||
status = i2c->writeReadFunc(i2c->handle, vrmI2c->addr, data, 0, 1);
|
status = i2c->writeReadFunc(i2c->handle, vrmI2c->addr, data, 0, 1);
|
||||||
|
|
Loading…
Reference in a new issue