Пример #1
0
static void MPPT_ask( void ) {
  data_index++;
  if (data_index >= NB_I2C_DATA) {
    /* Setting the current value */
    fbw_current_milliamp = MPPT_data[MPPT_IBAT_INDEX];

    MPPT_data[MPPT_ITOTAL_INDEX] = MPPT_data[MPPT_IBAT_INDEX] + MPPT_data[MPPT_ICONV_INDEX];
    DOWNLINK_SEND_MPPT(DefaultChannel, DefaultDevice, NB_DATA, MPPT_data);
    data_index = 0;
  }

  mppt_trans.buf[0] = data_index;
  i2c_transmit(&i2c0, &mppt_trans, MPPT_SLAVE_ADDR, 1);
  MPPT_status = MPPT_STATUS_ASKING;
}
Пример #2
0
void MPPT_periodic( void ) {
  MPPT_data[MPPT_ITOTAL_INDEX] = MPPT_data[MPPT_IBAT_INDEX] + MPPT_data[MPPT_ICONV_INDEX];

  RunOnceEvery(8, DOWNLINK_SEND_MPPT(DefaultChannel, NB_DATA, MPPT_data));
}