Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • derf/multipass
1 result
Show changes
Commits on Source (2)
...@@ -50,6 +50,9 @@ endif ...@@ -50,6 +50,9 @@ endif
ifdef CONFIG_arch_stm32f746zg_nucleo_driver_counter ifdef CONFIG_arch_stm32f746zg_nucleo_driver_counter
CXX_TARGETS += src/arch/stm32f746zg-nucleo/driver/counter.cc CXX_TARGETS += src/arch/stm32f746zg-nucleo/driver/counter.cc
ifneq (${app}, )
COMMON_FLAGS += -DCONFIG_arch_stm32f746zg_nucleo_driver_counter
endif
endif endif
ifdef CONFIG_arch_stm32f746zg_nucleo_driver_i2c ifdef CONFIG_arch_stm32f746zg_nucleo_driver_i2c
......
...@@ -64,19 +64,21 @@ extern void loop(); ...@@ -64,19 +64,21 @@ extern void loop();
volatile char run_loop = 0; volatile char run_loop = 0;
#endif #endif
// for 216 MHz(?) static volatile int delay_counter;
// horribly broken
void Arch::delay_us(unsigned int const us) void Arch::delay_us(unsigned int const us)
{ {
volatile int x = us * 145; delay_counter = us * 37;
while (x--) { while (delay_counter--) {
__asm("nop"); __asm("nop");
} }
} }
// horribly broken
void Arch::delay_ms(unsigned int const ms) void Arch::delay_ms(unsigned int const ms)
{ {
for (unsigned int i = 0; i < ms; i++) { for (unsigned int i = 0; i < ms; i++) {
volatile int x = 143990; delay_counter = 36364;
while (x--) { while (delay_counter--) {
__asm("nop"); __asm("nop");
} }
} }
......