From 97c5473416e56e061064dd8d820b87da633d8220 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 17 Apr 2023 14:09:16 +0200 Subject: [PATCH] Protab: Use USB boot loader in all examples --- protab/blink-usbboot/Makefile | 8 -------- protab/blink-usbboot/blink.c | 23 ----------------------- protab/blink/Makefile | 2 ++ protab/blink2/Makefile | 2 ++ protab/blink3/Makefile | 2 ++ protab/timer1-clock/Makefile | 2 ++ protab/timer2-irq/Makefile | 2 ++ protab/timer3-oc/Makefile | 2 ++ protab/timer4-pwm/Makefile | 2 ++ protab/timer4-pwm/timer.c | 2 +- protab/timer5-pwm/Makefile | 2 ++ protab/usart1/Makefile | 2 ++ protab/usart2/Makefile | 2 ++ 13 files changed, 21 insertions(+), 32 deletions(-) delete mode 100644 protab/blink-usbboot/Makefile delete mode 100644 protab/blink-usbboot/blink.c diff --git a/protab/blink-usbboot/Makefile b/protab/blink-usbboot/Makefile deleted file mode 100644 index 011261f..0000000 --- a/protab/blink-usbboot/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -ROOT=../.. -BINARY=blink -OBJS=blink.o -LIB_OBJS= -WITH_BOOT_LOADER=1 -WITH_DFU_FLASH=1 - -include $(ROOT)/mk/bluepill.mk diff --git a/protab/blink-usbboot/blink.c b/protab/blink-usbboot/blink.c deleted file mode 100644 index 7fe240a..0000000 --- a/protab/blink-usbboot/blink.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -int main(void) -{ - rcc_clock_setup_in_hse_8mhz_out_72mhz(); - rcc_periph_clock_enable(RCC_GPIOC); - - // PC13 = BluePill LED - gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO13); - - for (;;) { - gpio_clear(GPIOC, GPIO13); - - for (int i=0; i<10000000; i++) - asm volatile (""); - - gpio_set(GPIOC, GPIO13); - - for (int i=0; i<10000000; i++) - asm volatile (""); - } -} diff --git a/protab/blink/Makefile b/protab/blink/Makefile index 17a67e8..011261f 100644 --- a/protab/blink/Makefile +++ b/protab/blink/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=blink OBJS=blink.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/blink2/Makefile b/protab/blink2/Makefile index 17a67e8..011261f 100644 --- a/protab/blink2/Makefile +++ b/protab/blink2/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=blink OBJS=blink.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/blink3/Makefile b/protab/blink3/Makefile index 17a67e8..011261f 100644 --- a/protab/blink3/Makefile +++ b/protab/blink3/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=blink OBJS=blink.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/timer1-clock/Makefile b/protab/timer1-clock/Makefile index 9f34630..3e812c1 100644 --- a/protab/timer1-clock/Makefile +++ b/protab/timer1-clock/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=timer OBJS=timer.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/timer2-irq/Makefile b/protab/timer2-irq/Makefile index 9f34630..3e812c1 100644 --- a/protab/timer2-irq/Makefile +++ b/protab/timer2-irq/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=timer OBJS=timer.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/timer3-oc/Makefile b/protab/timer3-oc/Makefile index 9f34630..3e812c1 100644 --- a/protab/timer3-oc/Makefile +++ b/protab/timer3-oc/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=timer OBJS=timer.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/timer4-pwm/Makefile b/protab/timer4-pwm/Makefile index 9f34630..3e812c1 100644 --- a/protab/timer4-pwm/Makefile +++ b/protab/timer4-pwm/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=timer OBJS=timer.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/timer4-pwm/timer.c b/protab/timer4-pwm/timer.c index 77f5b43..4c07c09 100644 --- a/protab/timer4-pwm/timer.c +++ b/protab/timer4-pwm/timer.c @@ -23,7 +23,7 @@ int main(void) timer_update_on_overflow(TIM3); timer_set_oc_mode(TIM3, TIM_OC3, TIM_OCM_PWM1); - timer_set_oc_value(TIM3, TIM_OC3, 50); + timer_set_oc_value(TIM3, TIM_OC3, 150); timer_set_oc_polarity_high(TIM3, TIM_OC3); timer_enable_oc_output(TIM3, TIM_OC3); diff --git a/protab/timer5-pwm/Makefile b/protab/timer5-pwm/Makefile index 9f34630..3e812c1 100644 --- a/protab/timer5-pwm/Makefile +++ b/protab/timer5-pwm/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=timer OBJS=timer.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/usart1/Makefile b/protab/usart1/Makefile index 117ad11..096288f 100644 --- a/protab/usart1/Makefile +++ b/protab/usart1/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=usart OBJS=usart.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk diff --git a/protab/usart2/Makefile b/protab/usart2/Makefile index 117ad11..096288f 100644 --- a/protab/usart2/Makefile +++ b/protab/usart2/Makefile @@ -2,5 +2,7 @@ ROOT=../.. BINARY=usart OBJS=usart.o LIB_OBJS= +WITH_BOOT_LOADER=1 +WITH_DFU_FLASH=1 include $(ROOT)/mk/bluepill.mk -- 2.39.2