added a buffer size check

adc
Ondřej Hruška 7 years ago
parent d8933cbf81
commit 10cc13bc82
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 5
      units/adc/_adc_init.c

@ -133,6 +133,11 @@ error_t UADC_init(Unit *unit)
dbg("!! Need at least 1 channel");
return E_BAD_CONFIG;
}
if (priv->dma_buffer_size < priv->nb_channels*2*2) {
dbg("Insufficient buf size");
return E_BAD_CONFIG;
}
}
// ------------------- ENABLE CLOCKS --------------------------

Loading…
Cancel
Save