src/devices/block/drivers/mtk-sdmmc/mtk-sdmmc.cc
// Returns false if all tuning tests failed. Chooses the best window and sets sample and delay to
// the optimal sample edge and delay values.
Returns false if all tuning tests failed. Chooses the best window and sets sample and delay to
the optimal sample edge and delay values.
Returns false if all tuning tests failed . Chooses the best window and sets sample and delay to the optimal sample edge and delay values .
bool GetBestWindow(const sdmmc::TuneWindow& rising_window, const sdmmc::TuneWindow& falling_window,
                   uint32_t* sample, uint32_t* delay) {
  uint32_t rising_value = 0;
  uint32_t falling_value = 0;
  uint32_t rising_size = rising_window.GetDelay(&rising_value);
  uint32_t falling_size = falling_window.GetDelay(&falling_value);
  if (rising_size == 0 && falling_size == 0) {
    return false;
  }
  if (falling_size > rising_size) {
    *sample = sdmmc::MsdcIoCon::kSampleFallingEdge;
    *delay = falling_value;
  } else {
    *sample = sdmmc::MsdcIoCon::kSampleRisingEdge;
    *delay = rising_value;
  }
  return true;
}
bool GetBestWindow ( const sdmmc :: TuneWindow & rising_window , const sdmmc :: TuneWindow & falling_window , uint32_t * sample , uint32_t * delay ) { uint32_t rising_value = 0 ; uint32_t falling_value = 0 ; uint32_t rising_size = rising_window . GetDelay ( & rising_value ) ; uint32_t falling_size = falling_window . GetDelay ( & falling_value ) ; if ( rising_size == 0 && falling_size == 0 ) { return false ; } if ( falling_size > rising_size ) { * sample = sdmmc :: MsdcIoCon :: kSampleFallingEdge ; * delay = falling_value ; } else { * sample = sdmmc :: MsdcIoCon :: kSampleRisingEdge ; * delay = rising_value ; } return true ; }
Returns false if all tuning tests failed.
Returns false if all tuning tests failed .