Skip to content

Commit

Permalink
Fix potential integer overflow in shifts (cppcheck)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Oct 11, 2024
1 parent 8b2e38a commit 3ed9211
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hal/sama5d3.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,11 @@ static void dbgu_init(void) {
PMC_CLOCK_EN(GPIOB_PMCID);

/* Disable Pull */
GPIO_PPUDR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX);
GPIO_PPDDR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX);
GPIO_PPUDR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX);
GPIO_PPDDR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX);

/* Set "Peripheral A" */
GPIO_ASR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX);
GPIO_ASR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX);

/* Enable the peripheral clock for the DBGU */
PMC_CLOCK_EN(DBGU_PMCID);
Expand Down

0 comments on commit 3ed9211

Please sign in to comment.