Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions bricks/_common/arm_none_eabi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -253,24 +253,22 @@ PY_EXTRA_SRC_C += $(addprefix bricks/_common/,\
micropython.c \
)

ifeq ($(PB_MCU_FAMILY),STM32)
PY_EXTRA_SRC_C += $(addprefix bricks/_common_stm32/,\
# TODO: NXT should eventually use the same mphalport.c as well.
ifeq ($(PB_MCU_FAMILY),AT91SAM7)
PY_EXTRA_SRC_C += $(addprefix bricks/nxt/,\
mphalport.c \
)

ifeq ($(PB_MCU_SERIES),F0)
SRC_S += shared/runtime/gchelper_thumb1.s
else
SRC_S += shared/runtime/gchelper_thumb2.s
endif
endif

ifeq ($(PB_MCU_FAMILY),AT91SAM7)
PY_EXTRA_SRC_C += $(addprefix bricks/nxt/,\
PY_EXTRA_SRC_C += $(addprefix bricks/_common/,\
mphalport.c \
)
endif

# Not all MCUs support thumb2 instructions.
ifeq ($(PB_MCU_SERIES),$(filter $(PB_MCU_SERIES),AT91SAM7 F0 TIAM1808))
SRC_S += shared/runtime/gchelper_thumb1.s
else
SRC_S += shared/runtime/gchelper_thumb2.s
endif

# Skipping uart_irda_cir.c, gpio_v2.c, and hsi2c.c usbphyGS70.c, which
Expand Down Expand Up @@ -316,14 +314,6 @@ EV3_SRC_S = $(addprefix lib/pbio/platform/ev3/,\
start.S \
)

ifeq ($(PB_MCU_FAMILY),TIAM1808)
PY_EXTRA_SRC_C += $(addprefix bricks/ev3/,\
mphalport.c \
)

SRC_S += shared/runtime/gchelper_thumb1.s
endif

# STM32 Bluetooth stack

BLUENRG_SRC_C = $(addprefix lib/BlueNRG-MS/hci/,\
Expand Down
File renamed without changes.
82 changes: 0 additions & 82 deletions bricks/ev3/mphalport.c

This file was deleted.

11 changes: 4 additions & 7 deletions lib/pbio/drv/clock/clock_ev3.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// SPDX-License-Identifier: MPL-1.0
// SPDX-License-Identifier: MPL-1.0 AND MIT
// Copyright (c) 2016 Tobias Schießl

// SPDX-License-Identifier: MIT
// Copyright (c) 2024 The Pybricks Authors


#include <pbdrv/config.h>

#if PBDRV_CONFIG_CLOCK_TIAM1808
Expand Down Expand Up @@ -35,7 +32,7 @@ static const uint32_t timer_us_division = auxclk_freq_hz / 1000000;
/**
* The current tick in milliseconds
*/
volatile uint32_t systick_ms = 0;
volatile uint32_t pbdrv_clock_ticks;

/**
* The systick interrupt service routine (ISR) which will be called every millisecond.
Expand All @@ -45,7 +42,7 @@ void systick_isr_C(void) {
IntSystemStatusClear(SYS_INT_TINT12_0);
TimerIntStatusClear(SOC_TMR_0_REGS, TMR_INTSTAT12_TIMER_NON_CAPT);

++systick_ms;
pbdrv_clock_ticks++;

etimer_request_poll();
pbio_os_request_poll();
Expand Down Expand Up @@ -88,7 +85,7 @@ uint32_t pbdrv_clock_get_us(void) {
}

uint32_t pbdrv_clock_get_ms(void) {
return systick_ms;
return pbdrv_clock_ticks;
}

uint32_t pbdrv_clock_get_100us(void) {
Expand Down