The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
Revision 54:71b101360fb9, committed 2013-01-08
- Comitter:
- emilmont
- Date:
- Tue Jan 08 12:46:36 2013 +0000
- Parent:
- 53:63cdd78b2dc1
- Child:
- 55:d722ed6a4237
- Commit message:
- Support "stream as file" use case
Unify binary libraries
Update copyright
Changed in this revision
--- a/AnalogIn.h Thu Dec 06 17:03:27 2012 +0000 +++ b/AnalogIn.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/AnalogOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/AnalogOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/BusIn.h Thu Dec 06 17:03:27 2012 +0000 +++ b/BusIn.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/BusInOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/BusInOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/BusOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/BusOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/CAN.h Thu Dec 06 17:03:27 2012 +0000 +++ b/CAN.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/DigitalIn.h Thu Dec 06 17:03:27 2012 +0000 +++ b/DigitalIn.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/DigitalInOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/DigitalInOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/DigitalOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/DigitalOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/DirHandle.h Thu Dec 06 17:03:27 2012 +0000 +++ b/DirHandle.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/Ethernet.h Thu Dec 06 17:03:27 2012 +0000 +++ b/Ethernet.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FileBase.h Tue Jan 08 12:46:36 2013 +0000 @@ -0,0 +1,81 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef MBED_FILEBASE_H +#define MBED_FILEBASE_H + +typedef int FILEHANDLE; + +#include <stdio.h> + +#ifdef __ARMCC_VERSION +# define O_RDONLY 0 +# define O_WRONLY 1 +# define O_RDWR 2 +# define O_CREAT 0x0200 +# define O_TRUNC 0x0400 +# define O_APPEND 0x0008 + +# define NAME_MAX 255 + +typedef int mode_t; +typedef int ssize_t; +typedef long off_t; + +#else +# include <sys/fcntl.h> +# include <sys/types.h> +# include <sys/syslimits.h> +#endif + +#include "platform.h" + +namespace mbed { + +typedef enum { + FilePathType, + FileSystemPathType +} PathType; + +class FileBase { +public: + FileBase(const char *name, PathType t); + + virtual ~FileBase(); + + const char* getName(void); + PathType getPathType(void); + + static FileBase *lookup(const char *name, unsigned int len); + + static FileBase *get(int n); + +protected: + static FileBase *_head; + + FileBase *_next; + const char *_name; + PathType _path_type; +}; + +} // namespace mbed + +#endif
--- a/FileHandle.h Thu Dec 06 17:03:27 2012 +0000 +++ b/FileHandle.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FileLike.h Tue Jan 08 12:46:36 2013 +0000 @@ -0,0 +1,50 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef MBED_FILELIKE_H +#define MBED_FILELIKE_H + +#include "FileBase.h" +#include "FileHandle.h" + +namespace mbed { + +/* Class FileLike + * A file-like object is one that can be opened with fopen by + * fopen("/name", mode). It is intersection of the classes Base and + * FileHandle. + */ +class FileLike : public FileHandle, public FileBase { + +public: + /* Constructor FileLike + * + * Variables + * name - The name to use to open the file. + */ + FileLike(const char *name); + + virtual ~FileLike(); +}; + +} // namespace mbed + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FilePath.h Tue Jan 08 12:46:36 2013 +0000 @@ -0,0 +1,51 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef MBED_FILEPATH_H +#define MBED_FILEPATH_H + +#include "platform.h" + +#include "FileSystemLike.h" +#include "FileLike.h" + +namespace mbed { + +class FilePath { +public: + FilePath(const char* file_path); + + const char* fileName(void); + + bool isFileSystem(void); + FileSystemLike* fileSystem(void); + + bool isFile(void); + FileLike* file(void); + +private: + const char* file_name; + FileBase* fb; +}; + +} // namespace mbed + +#endif
--- a/FileSystemLike.h Thu Dec 06 17:03:27 2012 +0000 +++ b/FileSystemLike.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,21 +22,9 @@ #ifndef MBED_FILESYSTEMLIKE_H #define MBED_FILESYSTEMLIKE_H -#ifdef __ARMCC_VERSION -# define O_RDONLY 0 -# define O_WRONLY 1 -# define O_RDWR 2 -# define O_CREAT 0x0200 -# define O_TRUNC 0x0400 -# define O_APPEND 0x0008 -typedef int mode_t; - -#else -# include <sys/fcntl.h> -#endif - #include "platform.h" +#include "FileBase.h" #include "FileHandle.h" #include "DirHandle.h" @@ -48,7 +36,7 @@ * Implementations must define at least open (the default definitions * of the rest of the functions just return error values). */ -class FileSystemLike { +class FileSystemLike : public FileBase { public: /** FileSystemLike constructor @@ -59,15 +47,6 @@ virtual ~FileSystemLike(); - /* Function lookup - * Lookup and return the object that has the given name. - * - * Variables - * name - the name to lookup. - * len - the length of name. - */ - static FileSystemLike *lookup(const char *name, unsigned int len); - static DirHandle *opendir(); friend class BaseDirHandle; @@ -122,25 +101,8 @@ * -1 on failure. */ virtual int mkdir(const char *name, mode_t mode) { return -1; } - + // TODO other filesystem functions (mkdir, rm, rn, ls etc) - -protected: - static FileSystemLike *_head; - FileSystemLike *_next; - const char *_name; -}; - -class FilePath { -public: - FilePath(const char* file_path); - - const char* fileName(void); - FileSystemLike* fileSystem(void); - -private: - const char* file_name; - FileSystemLike* fs; }; } // namespace mbed
--- a/FunctionPointer.h Thu Dec 06 17:03:27 2012 +0000 +++ b/FunctionPointer.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/I2C.h Thu Dec 06 17:03:27 2012 +0000 +++ b/I2C.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/I2CSlave.h Thu Dec 06 17:03:27 2012 +0000 +++ b/I2CSlave.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/InterruptIn.h Thu Dec 06 17:03:27 2012 +0000 +++ b/InterruptIn.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
Binary file LPC11U24/ARM/capi.ar has changed
Binary file LPC11U24/ARM/cmsis_nvic.o has changed
Binary file LPC11U24/ARM/cpp.ar has changed
Binary file LPC11U24/ARM/mbed.ar has changed
Binary file LPC11U24/ARM/system_LPC11Uxx.o has changed
--- a/LPC11U24/PeripheralNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/PeripheralNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC11U24/PinNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/PinNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC11U24/PortNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/PortNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC11U24/device.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/device.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC11U24/gpio_object.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/gpio_object.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC11U24/objects.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/objects.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC11U24/power_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC11U24/power_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -26,12 +26,12 @@ #define PWRROMD_PRESENT -typedef struct _PWRD { +typedef struct _PWRD { void (*set_pll)(unsigned int cmd[], unsigned int resp[]); void (*set_power)(unsigned int cmd[], unsigned int resp[]); } PWRD; -typedef struct _ROM { +typedef struct _ROM { #ifdef USBROMD_PRESENT const USB * pUSBD; #else @@ -51,26 +51,26 @@ } ROM; //PLL setup related definitions -#define CPU_FREQ_EQU 0 //main PLL freq must be equal to the specified -#define CPU_FREQ_LTE 1 //main PLL freq must be less than or equal the specified -#define CPU_FREQ_GTE 2 //main PLL freq must be greater than or equal the specified -#define CPU_FREQ_APPROX 3 //main PLL freq must be as close as possible the specified +#define CPU_FREQ_EQU 0 //main PLL freq must be equal to the specified +#define CPU_FREQ_LTE 1 //main PLL freq must be less than or equal the specified +#define CPU_FREQ_GTE 2 //main PLL freq must be greater than or equal the specified +#define CPU_FREQ_APPROX 3 //main PLL freq must be as close as possible the specified -#define PLL_CMD_SUCCESS 0 //PLL setup successfully found -#define PLL_INVALID_FREQ 1 //specified freq out of range (either input or output) -#define PLL_INVALID_MODE 2 //invalid mode (see above for valid) specified -#define PLL_FREQ_NOT_FOUND 3 //specified freq not found under specified conditions -#define PLL_NOT_LOCKED 4 //PLL not locked => no changes to the PLL setup +#define PLL_CMD_SUCCESS 0 //PLL setup successfully found +#define PLL_INVALID_FREQ 1 //specified freq out of range (either input or output) +#define PLL_INVALID_MODE 2 //invalid mode (see above for valid) specified +#define PLL_FREQ_NOT_FOUND 3 //specified freq not found under specified conditions +#define PLL_NOT_LOCKED 4 //PLL not locked => no changes to the PLL setup //power setup elated definitions -#define PARAM_DEFAULT 0 //default power settings (voltage regulator, flash interface) -#define PARAM_CPU_PERFORMANCE 1 //setup for maximum CPU performance (higher current, more computation) -#define PARAM_EFFICIENCY 2 //balanced setting (power vs CPU performance) -#define PARAM_LOW_CURRENT 3 //lowest active current, lowest CPU performance +#define PARAM_DEFAULT 0 //default power settings (voltage regulator, flash interface) +#define PARAM_CPU_PERFORMANCE 1 //setup for maximum CPU performance (higher current, more computation) +#define PARAM_EFFICIENCY 2 //balanced setting (power vs CPU performance) +#define PARAM_LOW_CURRENT 3 //lowest active current, lowest CPU performance -#define PARAM_CMD_SUCCESS 0 //power setting successfully found -#define PARAM_INVALID_FREQ 1 //specified freq out of range (=0 or > 50 MHz) -#define PARAM_INVALID_MODE 2 //specified mode not valid (see above for valid) +#define PARAM_CMD_SUCCESS 0 //power setting successfully found +#define PARAM_INVALID_FREQ 1 //specified freq out of range (=0 or > 50 MHz) +#define PARAM_INVALID_MODE 2 //specified mode not valid (see above for valid) #define MAX_CLOCK_KHZ_PARAM 50000
Binary file LPC11U24/uARM/capi.ar has changed
Binary file LPC11U24/uARM/cmsis_nvic.o has changed
Binary file LPC11U24/uARM/cpp.ar has changed
Binary file LPC11U24/uARM/mbed.ar has changed
Binary file LPC11U24/uARM/system_LPC11Uxx.o has changed
Binary file LPC1768/ARM/capi.ar has changed
Binary file LPC1768/ARM/cmsis_nvic.o has changed
Binary file LPC1768/ARM/cpp.ar has changed
Binary file LPC1768/ARM/mbed.ar has changed
Binary file LPC1768/ARM/system_LPC17xx.o has changed
Binary file LPC1768/GCC_ARM/cmsis_nvic.o has changed
Binary file LPC1768/GCC_ARM/core_cm3.o has changed
Binary file LPC1768/GCC_ARM/libcapi.a has changed
Binary file LPC1768/GCC_ARM/libcpp.a has changed
Binary file LPC1768/GCC_ARM/libmbed.a has changed
Binary file LPC1768/GCC_ARM/startup_LPC17xx.o has changed
Binary file LPC1768/GCC_ARM/system_LPC17xx.o has changed
Binary file LPC1768/GCC_CR/libcapi.a has changed
Binary file LPC1768/GCC_CR/libcpp.a has changed
Binary file LPC1768/GCC_CR/libmbed.a has changed
Binary file LPC1768/GCC_CS/libcapi.a has changed
Binary file LPC1768/GCC_CS/libcpp.a has changed
Binary file LPC1768/GCC_CS/libmbed.a has changed
--- a/LPC1768/LPC17xx.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/LPC17xx.h Tue Jan 08 12:46:36 2013 +0000 @@ -129,8 +129,8 @@ __IO uint32_t CCLKCFG; __IO uint32_t USBCLKCFG; __IO uint32_t CLKSRCSEL; - __IO uint32_t CANSLEEPCLR; - __IO uint32_t CANWAKEFLAGS; + __IO uint32_t CANSLEEPCLR; + __IO uint32_t CANWAKEFLAGS; uint32_t RESERVED4[10]; __IO uint32_t EXTINT; /* External Interrupts */ uint32_t RESERVED5;
--- a/LPC1768/PeripheralNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/PeripheralNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC1768/PinNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/PinNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC1768/PortNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/PortNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC1768/device.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/device.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC1768/gpio_object.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/gpio_object.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC1768/objects.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC1768/objects.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
Binary file LPC2368/ARM/capi.ar has changed
Binary file LPC2368/ARM/cpp.ar has changed
Binary file LPC2368/ARM/mbed.ar has changed
--- a/LPC2368/LPC23xx.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/LPC23xx.h Tue Jan 08 12:46:36 2013 +0000 @@ -766,7 +766,7 @@ #define CM3_BASE (0xE0000000UL) */ -// TODO - #define VIC_BASE_ADDR 0xFFFFF000 +// TODO - #define VIC_BASE_ADDR 0xFFFFF000 #define LPC_WDT_BASE (0xE0000000) #define LPC_TIM0_BASE (0xE0004000)
--- a/LPC2368/PeripheralNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/PeripheralNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC2368/PinNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/PinNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC2368/PortNames.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/PortNames.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC2368/device.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/device.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC2368/gpio_object.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/gpio_object.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC2368/objects.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/objects.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/LPC2368/vector_defns.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LPC2368/vector_defns.h Tue Jan 08 12:46:36 2013 +0000 @@ -56,8 +56,8 @@ #define F_Bit 0x40 // when F bit is set, FIQ is disabled // MCU RAM -#define LPC2368_RAM_ADDRESS 0x40000000 // RAM Base -#define LPC2368_RAM_SIZE 0x8000 // 32KB +#define LPC2368_RAM_ADDRESS 0x40000000 // RAM Base +#define LPC2368_RAM_SIZE 0x8000 // 32KB // ISR Stack Allocation #define UND_stack_size 0x00000040 @@ -70,6 +70,6 @@ // Full Descending Stack, so top-most stack points to just above the top of RAM #define LPC2368_STACK_TOP (LPC2368_RAM_ADDRESS + LPC2368_RAM_SIZE) -#define USR_STACK_TOP (LPC2368_STACK_TOP - ISR_stack_size) +#define USR_STACK_TOP (LPC2368_STACK_TOP - ISR_stack_size) #endif
--- a/LocalFileSystem.h Thu Dec 06 17:03:27 2012 +0000 +++ b/LocalFileSystem.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/PortIn.h Thu Dec 06 17:03:27 2012 +0000 +++ b/PortIn.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/PortInOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/PortInOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/PortOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/PortOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/PwmOut.h Thu Dec 06 17:03:27 2012 +0000 +++ b/PwmOut.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/SPI.h Thu Dec 06 17:03:27 2012 +0000 +++ b/SPI.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/SPISlave.h Thu Dec 06 17:03:27 2012 +0000 +++ b/SPISlave.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/Serial.h Thu Dec 06 17:03:27 2012 +0000 +++ b/Serial.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,6 @@ class Serial : public Stream { public: - /** Create a Serial port, connected to the specified transmit and receive pins * * @param tx Transmit pin @@ -62,18 +61,13 @@ * @note * Either tx or rx may be specified as NC if unused */ - Serial(PinName tx, PinName rx) { - serial_init(&_serial, tx, rx); - serial_irq_handler(&_serial, Serial::_irq_handler, (uint32_t)this); - } - + Serial(PinName tx, PinName rx, const char *name=NULL); + /** Set the baud rate of the serial port * * @param baudrate The baudrate of the serial port (default = 9600). */ - void baud(int baudrate) { - serial_baud(&_serial, baudrate); - } + void baud(int baudrate); enum Parity { None = 0, @@ -94,44 +88,31 @@ * @param parity The parity used (Serial::None, Serial::Odd, Serial::Even, Serial::Forced1, Serial::Forced0; default = Serial::None) * @param stop The number of stop bits (1 or 2; default = 1) */ - void format(int bits = 8, Parity parity=Serial::None, int stop_bits=1) { - serial_format(&_serial, bits, (SerialParity)parity, stop_bits); - } - + void format(int bits = 8, Parity parity=Serial::None, int stop_bits=1); + /** Determine if there is a character available to read * * @returns * 1 if there is a character available to read, * 0 otherwise */ - int readable() { - return serial_readable(&_serial); - } - + int readable(); + /** Determine if there is space available to write a character * * @returns * 1 if there is space to write a character, * 0 otherwise */ - int writeable() { - return serial_writable(&_serial); - } - + int writeable(); + /** Attach a function to call whenever a serial interrupt is generated * * @param fptr A pointer to a void function, or 0 to set as none * @param type Which serial interrupt to attach the member function to (Seriall::RxIrq for receive, TxIrq for transmit buffer empty) */ - void attach(void (*fptr)(void), IrqType type=RxIrq) { - if (fptr) { - _irq[type].attach(fptr); - serial_irq_set(&_serial, (SerialIrq)type, 1); - } else { - serial_irq_set(&_serial, (SerialIrq)type, 0); - } - } - + void attach(void (*fptr)(void), IrqType type=RxIrq); + /** Attach a member function to call whenever a serial interrupt is generated * * @param tptr pointer to the object to call the member function on @@ -146,22 +127,13 @@ } } - static void _irq_handler(uint32_t id, SerialIrq irq_type) { - Serial *handler = (Serial*)id; - handler->_irq[irq_type].call(); - } + static void _irq_handler(uint32_t id, SerialIrq irq_type); protected: - virtual int _getc() { - return serial_getc(&_serial); - } + virtual int _getc(); + virtual int _putc(int c); - virtual int _putc(int c) { - serial_putc(&_serial, c); - return c; - } - - serial_t _serial; + serial_t _serial; FunctionPointer _irq[2]; };
--- a/Stream.h Thu Dec 06 17:03:27 2012 +0000 +++ b/Stream.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,14 +23,14 @@ #define MBED_STREAM_H #include "platform.h" -#include "FileHandle.h" +#include "FileLike.h" namespace mbed { -class Stream : public FileHandle { +class Stream : public FileLike { public: - Stream(void); + Stream(const char *name=NULL); virtual ~Stream(); int putc(int c);
--- a/Ticker.h Thu Dec 06 17:03:27 2012 +0000 +++ b/Ticker.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/Timeout.h Thu Dec 06 17:03:27 2012 +0000 +++ b/Timeout.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/Timer.h Thu Dec 06 17:03:27 2012 +0000 +++ b/Timer.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/TimerEvent.h Thu Dec 06 17:03:27 2012 +0000 +++ b/TimerEvent.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/analogin_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/analogin_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/analogout_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/analogout_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/can_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/can_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/can_helper.h Thu Dec 06 17:03:27 2012 +0000 +++ b/can_helper.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/error.h Thu Dec 06 17:03:27 2012 +0000 +++ b/error.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/ethernet_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/ethernet_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/gpio_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/gpio_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/gpio_irq_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/gpio_irq_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/i2c_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/i2c_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/mbed.h Thu Dec 06 17:03:27 2012 +0000 +++ b/mbed.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/mbed_debug.h Thu Dec 06 17:03:27 2012 +0000 +++ b/mbed_debug.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,72 +1,72 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef MBED_DEBUG_H -#define MBED_DEBUG_H -#include "device.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef DEVICE_STDIO_MESSAGES -#include <stdio.h> -#include <stdarg.h> - -/** Output a debug message - * - * @param format printf-style format string, followed by variables - */ -static inline void debug(const char *format, ...) { - va_list args; - va_start(args, format); - vfprintf(stderr, format, args); - va_end(args); -} - -/** Conditionally output a debug message - * - * NOTE: If the condition is constant false (!= 1) and the compiler optimization - * level is greater than 0, then the whole function will be compiled away. - * - * @param condition output only if condition is true (== 1) - * @param format printf-style format string, followed by variables - */ -static inline void debug_if(int condition, const char *format, ...) { - if (condition == 1) { - va_list args; - va_start(args, format); - vfprintf(stderr, format, args); - va_end(args); - } -} - -#else -static inline void debug(const char *format, ...) {} -static inline void debug_if(int condition, const char *format, ...) {} - -#endif - -#ifdef __cplusplus -} -#endif - -#endif +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef MBED_DEBUG_H +#define MBED_DEBUG_H +#include "device.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef DEVICE_STDIO_MESSAGES +#include <stdio.h> +#include <stdarg.h> + +/** Output a debug message + * + * @param format printf-style format string, followed by variables + */ +static inline void debug(const char *format, ...) { + va_list args; + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); +} + +/** Conditionally output a debug message + * + * NOTE: If the condition is constant false (!= 1) and the compiler optimization + * level is greater than 0, then the whole function will be compiled away. + * + * @param condition output only if condition is true (== 1) + * @param format printf-style format string, followed by variables + */ +static inline void debug_if(int condition, const char *format, ...) { + if (condition == 1) { + va_list args; + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + } +} + +#else +static inline void debug(const char *format, ...) {} +static inline void debug_if(int condition, const char *format, ...) {} + +#endif + +#ifdef __cplusplus +} +#endif + +#endif
--- a/mbed_interface.h Thu Dec 06 17:03:27 2012 +0000 +++ b/mbed_interface.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/pinmap.h Thu Dec 06 17:03:27 2012 +0000 +++ b/pinmap.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/platform.h Thu Dec 06 17:03:27 2012 +0000 +++ b/platform.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/port_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/port_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/pwmout_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/pwmout_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/rtc_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/rtc_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/rtc_time.h Thu Dec 06 17:03:27 2012 +0000 +++ b/rtc_time.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/semihost_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/semihost_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/serial_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/serial_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/sleep_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/sleep_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/spi_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/spi_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/toolchain.h Thu Dec 06 17:03:27 2012 +0000 +++ b/toolchain.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/us_ticker_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/us_ticker_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal
--- a/wait_api.h Thu Dec 06 17:03:27 2012 +0000 +++ b/wait_api.h Tue Jan 08 12:46:36 2013 +0000 @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2012 ARM Limited + * Copyright (c) 2006-2013 ARM Limited * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal