Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 2doejemplo Labo_TRSE_Drone
Fork of mbed by
SemihostFileSystem.h@0:82220227f4fa, 2008-04-08 (annotated)
- Committer:
- simon.ford@mbed.co.uk
- Date:
- Tue Apr 08 14:12:21 2008 +0000
- Revision:
- 0:82220227f4fa
- Child:
- 1:6b7f447ca868
A first develoment release of the mbed libraries
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| simon.ford@mbed.co.uk | 0:82220227f4fa | 1 | /* mbed Microcontroller Library - SemihostFileSystem |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 2 | * Copyright (c) 2007-2008, sford |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 3 | */ |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 4 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 5 | #ifndef MBED_SEMIHOSTFILESYSTEM_H |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 6 | #define MBED_SEMIHOSTFILESYSTEM_H |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 7 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 8 | #include "rt_sys.h" |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 9 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 10 | #include "SemihostFileHandle.h" |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 11 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 12 | extern "C" FILEHANDLE $Super$$_sys_open(const char *name, int openmode); |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 13 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 14 | namespace mbed { |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 15 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 16 | /* Class SemihostFileSystem |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 17 | * A file system invoking the standard semihosting implementation |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 18 | */ |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 19 | class SemihostFileSystem : public Base { |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 20 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 21 | public: |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 22 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 23 | SemihostFileSystem(char* n) { |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 24 | name(n); |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 25 | _type = "SemihostFileSystem"; |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 26 | } |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 27 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 28 | virtual FILEHANDLE sys_open(const char* name, int openmode) { |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 29 | FILEHANDLE fh = $Super$$_sys_open(name, openmode); |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 30 | FileHandle* fhc = new SemihostFileHandle(fh); |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 31 | return (FILEHANDLE)fhc; |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 32 | } |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 33 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 34 | }; |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 35 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 36 | } // namespace mbed |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 37 | |
| simon.ford@mbed.co.uk | 0:82220227f4fa | 38 | #endif |
