From 6746e37088ce8ba03529c1226bd216705edb2b1f Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 10 Apr 2015 01:25:48 +0900 Subject: Remove core library and build files --- common/mbed/bootloader.c | 4 ---- common/mbed/suspend.c | 6 ------ common/mbed/timer.c | 41 -------------------------------------- common/mbed/xprintf.cpp | 51 ------------------------------------------------ common/mbed/xprintf.h | 17 ---------------- 5 files changed, 119 deletions(-) delete mode 100644 common/mbed/bootloader.c delete mode 100644 common/mbed/suspend.c delete mode 100644 common/mbed/timer.c delete mode 100644 common/mbed/xprintf.cpp delete mode 100644 common/mbed/xprintf.h (limited to 'common/mbed') diff --git a/common/mbed/bootloader.c b/common/mbed/bootloader.c deleted file mode 100644 index b51e83943a..0000000000 --- a/common/mbed/bootloader.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "bootloader.h" - - -void bootloader_jump(void) {} diff --git a/common/mbed/suspend.c b/common/mbed/suspend.c deleted file mode 100644 index 32651574f8..0000000000 --- a/common/mbed/suspend.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - - -void suspend_power_down(void) {} -bool suspend_wakeup_condition(void) { return true; } -void suspend_wakeup_init(void) {} diff --git a/common/mbed/timer.c b/common/mbed/timer.c deleted file mode 100644 index c357ceb786..0000000000 --- a/common/mbed/timer.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "cmsis.h" -#include "timer.h" - -/* Mill second tick count */ -volatile uint32_t timer_count = 0; - -/* Timer interrupt handler */ -void SysTick_Handler(void) { - timer_count++; -} - -void timer_init(void) -{ - timer_count = 0; - SysTick_Config(SystemCoreClock / 1000); /* 1ms tick */ -} - -void timer_clear(void) -{ - timer_count = 0; -} - -uint16_t timer_read(void) -{ - return (uint16_t)(timer_count & 0xFFFF); -} - -uint32_t timer_read32(void) -{ - return timer_count; -} - -uint16_t timer_elapsed(uint16_t last) -{ - return TIMER_DIFF_16(timer_read(), last); -} - -uint32_t timer_elapsed32(uint32_t last) -{ - return TIMER_DIFF_32(timer_read32(), last); -} diff --git a/common/mbed/xprintf.cpp b/common/mbed/xprintf.cpp deleted file mode 100644 index 3647ece751..0000000000 --- a/common/mbed/xprintf.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -//#include -#include "mbed.h" -#include "mbed/xprintf.h" - - -#define STRING_STACK_LIMIT 120 - -//TODO -int xprintf(const char* format, ...) { return 0; } - -#if 0 -/* mbed Serial */ -Serial ser(UART_TX, UART_RX); - -/* TODO: Need small implementation for embedded */ -int xprintf(const char* format, ...) -{ - /* copy from mbed/common/RawSerial.cpp */ - std::va_list arg; - va_start(arg, format); - int len = vsnprintf(NULL, 0, format, arg); - if (len < STRING_STACK_LIMIT) { - char temp[STRING_STACK_LIMIT]; - vsprintf(temp, format, arg); - ser.puts(temp); - } else { - char *temp = new char[len + 1]; - vsprintf(temp, format, arg); - ser.puts(temp); - delete[] temp; - } - va_end(arg); - return len; - -/* Fail: __builtin_va_arg_pack? - * https://gcc.gnu.org/onlinedocs/gcc-4.3.5/gcc/Constructing-Calls.html#Constructing-Calls - void *arg = __builtin_apply_args(); - void *ret = __builtin_apply((void*)(&(ser.printf)), arg, 100); - __builtin_return(ret) -*/ -/* Fail: varargs can not be passed to printf - //int r = ser.printf("test %i\r\n", 123); - va_list arg; - va_start(arg, format); - int r = ser.printf(format, arg); - va_end(arg); - return r; -*/ -} -#endif diff --git a/common/mbed/xprintf.h b/common/mbed/xprintf.h deleted file mode 100644 index 26bc529e5b..0000000000 --- a/common/mbed/xprintf.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef XPRINTF_H -#define XPRINTF_H - -//#define xprintf(format, ...) __xprintf(format, ##__VA_ARGS__) - -#ifdef __cplusplus -extern "C" { -#endif - -int xprintf(const char *format, ...); - -#ifdef __cplusplus -} -#endif - - -#endif -- cgit v1.2.3