pkarashchenko commented on code in PR #7702: URL: https://github.com/apache/nuttx/pull/7702#discussion_r1037678110
########## arch/arm/src/sama5/sam_adc.c: ########## @@ -1069,10 +1137,13 @@ static void sam_adc_reset(struct adc_dev_s *dev) /* Reset gain, offset, differential modes */ +#if defined (ATSAMA5D3) Review Comment: ```suggestion #if defined(ATSAMA5D3) ``` ########## arch/arm/src/sama5/sam_adc.c: ########## @@ -1335,7 +1417,7 @@ static int sam_adc_settimer(struct sam_adc_s *priv, uint32_t frequency, priv->tc = sam_tc_allocate(channel, mode); if (!priv->tc) { - aerr("ERROR: Failed to allocate channel %d mode %08" PRIx32 "\n", + aerr("ERROR: Failed to allocate channel %d mode %08x\n", channel, mode); Review Comment: Why this is changed? the original version seems to be correct? ########## arch/arm/src/sama5/sam_adc.c: ########## @@ -1069,10 +1137,13 @@ static void sam_adc_reset(struct adc_dev_s *dev) /* Reset gain, offset, differential modes */ +#if defined (ATSAMA5D3) sam_adc_putreg(priv, SAM_ADC_CGR, 0); + #endif + sam_adc_putreg(priv, SAM_ADC_COR, 0); -#ifndef CONFIG_SAMA5_ADC_SWTRIG +#if !defined CONFIG_SAMA5_ADC_SWTRIG && !defined CONFIG_SAMA5_TSD Review Comment: ```suggestion #if !defined(CONFIG_SAMA5_ADC_SWTRIG) && !defined(CONFIG_SAMA5_TSD) ``` ########## arch/arm/src/sama5/sam_tsd.c: ########## @@ -1655,7 +1755,7 @@ int sam_tsd_register(struct sam_adc_s *adc, int minor) /* Initialize the touchscreen device driver instance */ - priv->adc = adc; /* Save the ADC device handle */ + priv->adc = adc; /* Save the ADC device handle */ Review Comment: why this is changed? ########## arch/arm/src/sama5/sam_adc.c: ########## @@ -1728,7 +1890,8 @@ static void sam_adc_gain(struct sam_adc_s *priv) /* Set GAIN0 only. GAIN0 will be used for all channels. */ sam_adc_putreg(priv, SAM_ADC_CGR, ADC_CGR_GAIN0(CONFIG_SAMA5_ADC_GAIN)); -#endif +#endif /* CONFIG_SAMA5_ADC_ANARCH */ Review Comment: ```suggestion # endif /* CONFIG_SAMA5_ADC_ANARCH */ ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org