mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #1795 from 0xc0170/dev_mbedos_additions
Small changes (docs plus assert)pull/1804/head
commit
60c862c206
|
@ -19,6 +19,15 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* General C++ Object Thunking class
|
||||
*
|
||||
* - allows direct callbacks to non-static C++ class functions
|
||||
* - keeps track for the corresponding class instance
|
||||
* - supports an optional context parameter for the called function
|
||||
* - ideally suited for class object receiving interrupts (NVIC_SetVector)
|
||||
*/
|
||||
|
||||
#ifndef __CTHUNK_H__
|
||||
#define __CTHUNK_H__
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
*
|
||||
* @param location The location to seek to. Must be a value returned by telldir.
|
||||
*/
|
||||
virtual void seekdir(off_t location) { }
|
||||
virtual void seekdir(off_t location) { (void)location;}
|
||||
|
||||
virtual ~DirHandle() {}
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
* @param filename the name of the file to remove.
|
||||
* @param returns 0 on success, -1 on failure.
|
||||
*/
|
||||
virtual int remove(const char *filename) { return -1; };
|
||||
virtual int remove(const char *filename) { (void) filename; return -1; };
|
||||
|
||||
/** Rename a file in the filesystem.
|
||||
*
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
* 0 on success,
|
||||
* -1 on failure.
|
||||
*/
|
||||
virtual int rename(const char *oldname, const char *newname) { return -1; };
|
||||
virtual int rename(const char *oldname, const char *newname) { (void) oldname, (void) newname; return -1; };
|
||||
|
||||
/** Opens a directory in the filesystem and returns a DirHandle
|
||||
* representing the directory stream.
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
* A DirHandle representing the directory stream, or
|
||||
* NULL on failure.
|
||||
*/
|
||||
virtual DirHandle *opendir(const char *name) { return NULL; };
|
||||
virtual DirHandle *opendir(const char *name) { (void) name; return NULL; };
|
||||
|
||||
/** Creates a directory in the filesystem.
|
||||
*
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
* 0 on success,
|
||||
* -1 on failure.
|
||||
*/
|
||||
virtual int mkdir(const char *name, mode_t mode) { return -1; }
|
||||
virtual int mkdir(const char *name, mode_t mode) { (void) name, (void) mode; return -1; }
|
||||
|
||||
// TODO other filesystem functions (mkdir, rm, rn, ls etc)
|
||||
};
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
// mbed Debug libraries
|
||||
#include "mbed_error.h"
|
||||
#include "mbed_interface.h"
|
||||
#include "mbed_assert.h"
|
||||
|
||||
// mbed Peripheral components
|
||||
#include "DigitalIn.h"
|
||||
|
|
|
@ -14,9 +14,19 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "mbed_assert.h"
|
||||
#include "mbed_error.h"
|
||||
#include "device.h"
|
||||
|
||||
#if DEVICE_STDIO_MESSAGES
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "mbed_interface.h"
|
||||
|
||||
void mbed_assert_internal(const char *expr, const char *file, int line)
|
||||
{
|
||||
error("mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
|
||||
#if DEVICE_STDIO_MESSAGES
|
||||
fprintf(stderr, "mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
|
||||
#endif
|
||||
mbed_die();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue