aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-11-29 16:16:05 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2012-04-11 16:56:53 -0400
commit1ffbef80396cdb13a7976de0eefdc3017ca4499c (patch)
tree83feeb804c262dbbab6c5bc5a3f693ead5c024ce
parent2ab2f4d3784692f8cd0e79d24638157926f894ca (diff)
downloadlibrambutan-1ffbef80396cdb13a7976de0eefdc3017ca4499c.tar.gz
librambutan-1ffbef80396cdb13a7976de0eefdc3017ca4499c.zip
[UNDO] Rip out a bunch of F1-only bits from libmaple proper
We'll need to bring this functionality back online piecemeal as we add F2 support. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--Makefile2
-rw-r--r--libmaple/rules.mk13
-rw-r--r--libmaple/util.c62
3 files changed, 34 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index 785b9a6..0784644 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@ ifeq ($(LIBMAPLE_MODULES),)
else
LIBMAPLE_MODULES += $(SRCROOT)/libmaple
endif
-LIBMAPLE_MODULES += $(SRCROOT)/libmaple/usb # USB FS device
+# LIBMAPLE_MODULES += $(SRCROOT)/libmaple/usb # USB FS device
LIBMAPLE_MODULES += $(LIBMAPLE_MODULE_SERIES) # STM32 series submodule in libmaple
LIBMAPLE_MODULES += $(SRCROOT)/wirish
# Official libraries:
diff --git a/libmaple/rules.mk b/libmaple/rules.mk
index 61d4edd..8802161 100644
--- a/libmaple/rules.mk
+++ b/libmaple/rules.mk
@@ -11,23 +11,12 @@ LIBMAPLE_PRIVATE_INCLUDES := -I$(LIBMAPLE_PATH)
CFLAGS_$(d) = $(LIBMAPLE_PRIVATE_INCLUDES) $(LIBMAPLE_INCLUDES) -Wall -Werror
# Local rules and targets
-cSRCS_$(d) := adc.c \
- dac.c \
- dma.c \
- exti.c \
- flash.c \
- fsmc.c \
+cSRCS_$(d) := flash.c \
gpio.c \
- iwdg.c \
nvic.c \
- pwr.c \
- i2c.c \
rcc.c \
- spi.c \
syscalls.c \
systick.c \
- timer.c \
- usart.c \
util.c
sSRCS_$(d) := exc.S
diff --git a/libmaple/util.c b/libmaple/util.c
index 07e9572..96050a1 100644
--- a/libmaple/util.c
+++ b/libmaple/util.c
@@ -62,18 +62,18 @@ void __error(void) {
/* Turn off peripheral interrupts */
nvic_irq_disable_all();
- /* Turn off timers */
- timer_disable_all();
+ /* /\* Turn off timers *\/ */
+ /* timer_disable_all(); */
- /* Turn off ADC */
- adc_disable_all();
+ /* /\* Turn off ADC *\/ */
+ /* adc_disable_all(); */
- /* Turn off all USARTs */
- usart_disable_all();
+ /* /\* Turn off all USARTs *\/ */
+ /* usart_disable_all(); */
- /* Turn the USB interrupt back on so the bootloader keeps on functioning */
- nvic_irq_enable(NVIC_USB_HP_CAN_TX);
- nvic_irq_enable(NVIC_USB_LP_CAN_RX0);
+ /* /\* Turn the USB interrupt back on so the bootloader keeps on functioning *\/ */
+ /* nvic_irq_enable(NVIC_USB_HP_CAN_TX); */
+ /* nvic_irq_enable(NVIC_USB_LP_CAN_RX0); */
/* Reenable global interrupts */
nvic_globalirq_enable();
@@ -85,9 +85,9 @@ void __error(void) {
* @sideeffect Configures ERROR_USART appropriately for writing.
*/
void _enable_error_usart() {
- gpio_set_mode(ERROR_TX_PORT, ERROR_TX_PIN, GPIO_AF_OUTPUT_PP);
- usart_init(ERROR_USART);
- usart_set_baud_rate(ERROR_USART, ERROR_USART_CLK_SPEED, ERROR_USART_BAUD);
+ /* gpio_set_mode(ERROR_TX_PORT, ERROR_TX_PIN, GPIO_AF_OUTPUT_PP); */
+ /* usart_init(ERROR_USART); */
+ /* usart_set_baud_rate(ERROR_USART, ERROR_USART_CLK_SPEED, ERROR_USART_BAUD); */
}
/**
@@ -100,17 +100,17 @@ void _enable_error_usart() {
*/
void _fail(const char* file, int line, const char* exp) {
/* Initialize the error USART */
- _enable_error_usart();
-
- /* Print failed assert message */
- usart_putstr(ERROR_USART, "ERROR: FAILED ASSERT(");
- usart_putstr(ERROR_USART, exp);
- usart_putstr(ERROR_USART, "): ");
- usart_putstr(ERROR_USART, file);
- usart_putstr(ERROR_USART, ": ");
- usart_putudec(ERROR_USART, line);
- usart_putc(ERROR_USART, '\n');
- usart_putc(ERROR_USART, '\r');
+ /* _enable_error_usart(); */
+
+ /* /\* Print failed assert message *\/ */
+ /* usart_putstr(ERROR_USART, "ERROR: FAILED ASSERT("); */
+ /* usart_putstr(ERROR_USART, exp); */
+ /* usart_putstr(ERROR_USART, "): "); */
+ /* usart_putstr(ERROR_USART, file); */
+ /* usart_putstr(ERROR_USART, ": "); */
+ /* usart_putudec(ERROR_USART, line); */
+ /* usart_putc(ERROR_USART, '\n'); */
+ /* usart_putc(ERROR_USART, '\r'); */
/* Shutdown and error fade */
__error();
@@ -130,14 +130,16 @@ void __assert_func(const char* file, int line, const char* method,
* error state with the throbbing LED indicator.
*/
void abort() {
- /* Initialize the error USART */
- _enable_error_usart();
+ /* /\* Initialize the error USART *\/ */
+ /* _enable_error_usart(); */
- /* Print abort message. */
- usart_putstr(ERROR_USART, "ERROR: PROGRAM ABORTED VIA abort()\n\r");
+ /* /\* Print abort message. *\/ */
+ /* usart_putstr(ERROR_USART, "ERROR: PROGRAM ABORTED VIA abort()\n\r"); */
- /* Shutdown and error fade */
- __error();
+ /* /\* Shutdown and error fade *\/ */
+ /* __error(); */
+ while (1)
+ ;
}
/**
@@ -145,7 +147,7 @@ void abort() {
* @sideeffect Sets output push-pull on ERROR_LED_PIN.
*/
void throb(void) {
-#ifdef HAVE_ERROR_LED
+#if 0
int32 slope = 1;
uint32 CC = 0x0000;
uint32 TOP_CNT = 0x0200;