diff -crN buildroot-2013.08.1-cm-3g-20150616-1/board/ckb/cm-3g/samples/i2c_currentpower_monitor/current_power_monitor.sh buildroot-2013.08.1-cm-3g-20150616-1-INA226/board/ckb/cm-3g/samples/i2c_currentpower_monitor/current_power_monitor.sh
*** buildroot-2013.08.1-cm-3g-20150616-1/board/ckb/cm-3g/samples/i2c_currentpower_monitor/current_power_monitor.sh	2015-05-26 15:22:24.000000000 +0900
--- buildroot-2013.08.1-cm-3g-20150616-1-INA226/board/ckb/cm-3g/samples/i2c_currentpower_monitor/current_power_monitor.sh	2015-06-22 15:36:02.237600000 +0900
***************
*** 113,119 ****
  
  #Calculate current
  val=$( i2cread $i2c_bus $i2c_addr 4 )
! current=`echo $val $cur_LSB | awk '{div=$1*$2; printf"%0.3f\n", div }'`
  
  echo
  echo "Target Voltage=$voltage mV"
--- 113,127 ----
  
  #Calculate current
  val=$( i2cread $i2c_bus $i2c_addr 4 )
! #get the sign
! sign=`echo $(($val & 0x8000))`
! val=`echo $(($val & 0x7FFF))`
! if ! [ $sign -eq 0 ]; then
! 	sign=-1	
! else
! 	sign=1	
! fi
! current=`echo $val $cur_LSB $sign | awk '{div=$1*$2*$3; printf"%0.3f\n", div }'`
  
  echo
  echo "Target Voltage=$voltage mV"
