diff --git a/cpu/stm32/cpu_common.c b/cpu/stm32/cpu_common.c index f1d0055b63..6dbfae8e2a 100644 --- a/cpu/stm32/cpu_common.c +++ b/cpu/stm32/cpu_common.c @@ -58,7 +58,7 @@ static const uint8_t apbmul[] = { #endif }; -uint32_t periph_apb_clk(uint8_t bus) +uint32_t periph_apb_clk(bus_t bus) { #ifdef CLOCK_APB2 if (bus == APB2) { @@ -70,7 +70,7 @@ uint32_t periph_apb_clk(uint8_t bus) return CLOCK_APB1; } -uint32_t periph_timer_clk(uint8_t bus) +uint32_t periph_timer_clk(bus_t bus) { return periph_apb_clk(bus) * apbmul[bus]; } diff --git a/cpu/stm32/include/periph/cpu_common.h b/cpu/stm32/include/periph/cpu_common.h index eb7cb9b518..16b173c349 100644 --- a/cpu/stm32/include/periph/cpu_common.h +++ b/cpu/stm32/include/periph/cpu_common.h @@ -119,7 +119,7 @@ typedef enum { * * @return bus clock frequency in Hz */ -uint32_t periph_apb_clk(uint8_t bus); +uint32_t periph_apb_clk(bus_t bus); /** * @brief Get the actual timer clock frequency @@ -128,7 +128,7 @@ uint32_t periph_apb_clk(uint8_t bus); * * @return timer clock frequency in Hz */ -uint32_t periph_timer_clk(uint8_t bus); +uint32_t periph_timer_clk(bus_t bus); /** * @brief Enable the given peripheral clock @@ -144,7 +144,7 @@ void periph_clk_en(bus_t bus, uint32_t mask); * @param[in] bus bus the peripheral is connected to * @param[in] mask bit in the RCC enable register */ -void periph_lpclk_dis(bus_t bus, uint32_t mask); +void periph_clk_dis(bus_t bus, uint32_t mask); /** * @brief Enable the given peripheral clock in low power mode @@ -160,7 +160,7 @@ void periph_lpclk_en(bus_t bus, uint32_t mask); * @param[in] bus bus the peripheral is connected to * @param[in] mask bit in the RCC enable register */ -void periph_clk_dis(bus_t bus, uint32_t mask); +void periph_lpclk_dis(bus_t bus, uint32_t mask); #ifdef __cplusplus } diff --git a/sys/usb/usbus/msc/scsi.c b/sys/usb/usbus/msc/scsi.c index 50ab2db2f3..b72ef34daf 100644 --- a/sys/usb/usbus/msc/scsi.c +++ b/sys/usb/usbus/msc/scsi.c @@ -163,9 +163,9 @@ static void _scsi_read_format_capacities(usbus_handler_t *handler, uint8_t lun) pkt->type = SCSI_READ_FMT_CAPA_TYPE_FORMATTED; /* Manage endianness, bytes 11..9 -> LSB..MSB */ - pkt->blk_len[0] = (block_size >> 16) && 0xFF; - pkt->blk_len[1] = (block_size >> 8) && 0xFF; - pkt->blk_len[2] = block_size && 0xFF; + pkt->blk_len[0] = (block_size >> 16) & 0xFF; + pkt->blk_len[1] = (block_size >> 8) & 0xFF; + pkt->blk_len[2] = block_size & 0xFF; /* copy into ep buffer */ usbdev_ep_xmit(msc->ep_in->ep, (uint8_t *)pkt, sizeof(msc_read_fmt_capa_pkt_t));