|
@@ -51,7 +51,7 @@ void dynamic_gpio_addressing(){
|
|
|
void pi_i2c_mcu(){
|
|
void pi_i2c_mcu(){
|
|
|
//uint8_t rxBuffer_getLimits[12];
|
|
//uint8_t rxBuffer_getLimits[12];
|
|
|
uint8_t receivedCommand= DL_I2C_receiveTargetData(I2C_0_INST);
|
|
uint8_t receivedCommand= DL_I2C_receiveTargetData(I2C_0_INST);
|
|
|
- printf("Received Command: 0x%02X\n", receivedCommand);
|
|
|
|
|
|
|
+ //printf("Received Command: 0x%02X\n", receivedCommand);
|
|
|
if(receivedCommand == CMD_GET_BATTERY_STATUS){
|
|
if(receivedCommand == CMD_GET_BATTERY_STATUS){
|
|
|
//Example: i2cget -y 1 0x20 0x01 i 4
|
|
//Example: i2cget -y 1 0x20 0x01 i 4
|
|
|
uint8_t status_buffer[NUM_SLOTS];
|
|
uint8_t status_buffer[NUM_SLOTS];
|
|
@@ -71,7 +71,7 @@ void pi_i2c_mcu(){
|
|
|
//0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
|
//0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
|
|
|
|
|
|
|
uint8_t requestedSlot = (receivedCommand & 0xF0)>>4;
|
|
uint8_t requestedSlot = (receivedCommand & 0xF0)>>4;
|
|
|
- printf("Requested slot:%d\n", requestedSlot);
|
|
|
|
|
|
|
+ //printf("Requested slot:%d\n", requestedSlot);
|
|
|
BatteryData battery_measure;
|
|
BatteryData battery_measure;
|
|
|
if(requestedSlot >= NUM_SLOTS){
|
|
if(requestedSlot >= NUM_SLOTS){
|
|
|
DL_I2C_flushTargetRXFIFO(I2C_0_INST);
|
|
DL_I2C_flushTargetRXFIFO(I2C_0_INST);
|