anchor.diff:    tmp3: HAL_SD_ErrorTypedef;
     errorstate: HAL_SD_ErrorTypedef;
   begin
  +  errorstate:=SD_OK;
  +
     (* Wait for DMA/SD transfer end or SD error variables to be in SD handle *)
     tmp1 := hsd.DmaTransferCplt;
     tmp2 := hsd.SdTransferCplt;
  
positive.code:   errorstate: HAL_SD_ErrorTypedef;
    response_r1: longword;
  begin
    while (not __HAL_SD_SDMMC_GET_FLAG(hsd, SDMMC_FLAG_CCRCFAIL or SDMMC_FLAG_CMDREND or SDMMC_FLAG_CTIMEOUT)) do
    begin
    end;
  
negative.code:   errorstate: HAL_SD_ErrorTypedef;
    sd_rca: word;
  begin
    errorstate:=SD_OK;
  
    if (SDMMC_GetPowerState(hsd.Instance^) = 0) (* Power off *) then
    begin
      errorstate := SD_REQUEST_NOT_APPLICABLE;
  