Skip to content

Commit

Permalink
Merge branch 'commaai:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rav4kumar authored Mar 4, 2024
2 parents 30fdf0c + ea156f7 commit c34d4d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions board/drivers/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ int current_int0_alt_setting = 0;

void *USB_ReadPacket(void *dest, uint16_t len) {
uint32_t *dest_copy = (uint32_t *)dest;
uint32_t count32b = (len + 3U) / 4U;
uint32_t count32b = ((uint32_t)len + 3U) / 4U;

for (uint32_t i = 0; i < count32b; i++) {
*dest_copy = USBx_DFIFO(0);
Expand All @@ -379,9 +379,9 @@ void USB_WritePacket(const void *src, uint16_t len, uint32_t ep) {
hexdump(src, len);
#endif

uint32_t numpacket = (len + (USBPACKET_MAX_SIZE - 1U)) / USBPACKET_MAX_SIZE;
uint32_t numpacket = ((uint32_t)len + (USBPACKET_MAX_SIZE - 1U)) / USBPACKET_MAX_SIZE;
uint32_t count32b = 0;
count32b = (len + 3U) / 4U;
count32b = ((uint32_t)len + 3U) / 4U;

// TODO: revisit this
USBx_INEP(ep)->DIEPTSIZ = ((numpacket << 19) & USB_OTG_DIEPTSIZ_PKTCNT) |
Expand Down
2 changes: 1 addition & 1 deletion board/stm32h7/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ void clock_init(void) {
// Set power mode to direct SMPS power supply(depends on the board layout)
#ifndef STM32H723
register_set(&(PWR->CR3), PWR_CR3_SMPSEN, 0xFU); // powered only by SMPS
#endif
// Set VOS level (VOS3 to 170Mhz, VOS2 to 300Mhz, VOS1 to 400Mhz, VOS0 to 550Mhz)
register_set(&(PWR->D3CR), PWR_D3CR_VOS_1 | PWR_D3CR_VOS_0, 0xC000U); //VOS1, needed for 80Mhz CAN FD
while ((PWR->CSR1 & PWR_CSR1_ACTVOSRDY) == 0);
while ((PWR->CSR1 & PWR_CSR1_ACTVOS) != (PWR->D3CR & PWR_D3CR_VOS)); // check that VOS level was actually set
#endif

// Configure Flash ACR register LATENCY and WRHIGHFREQ (VOS0 range!)
register_set(&(FLASH->ACR), FLASH_ACR_LATENCY_2WS | 0x20U, 0x3FU); // VOS2, AXI 100MHz-150MHz
Expand Down
2 changes: 1 addition & 1 deletion tests/misra/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd $CPPCHECK_DIR
VERS="2.13.0"
git fetch --all --tags
git checkout $VERS
git cherry-pick -n f6b538e855f0bacea33c4074664628024ef39dc6
git cherry-pick -n f6b538e855f0bacea33c4074664628024ef39dc6 b11b42087ff29569bc3740f5aa07eb6616ea4f63

#make clean
make MATCHCOMPILTER=yes CXXFLAGS="-O2" -j8
1 change: 0 additions & 1 deletion tests/misra/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ misra-c2012-1.2 # this is from the extensions (e.g. __typeof__) used in the MIN
misra-c2012-2.5
misra-c2012-8.7
misra-c2012-8.4
misra-c2012-10.6
misra-c2012-21.15

0 comments on commit c34d4d7

Please sign in to comment.