Skip to content

Commit d92806c

Browse files
authored
Merge pull request #5 from pilotak/master
add missing get_type() from BlockDevice
2 parents 3839563 + b87c0f6 commit d92806c

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

.travis.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
dist: xenial
2+
language: python
3+
python: 2.7
4+
5+
install:
6+
# Get arm-none-eabi-gcc
7+
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
8+
- sudo apt-get update -qq
9+
- sudo apt-get install -qq gcc-arm-embedded
10+
# Get dependencies
11+
- git clone https://github.com/armmbed/mbed-os.git
12+
# Install python dependencies
13+
# - python -m pip install --upgrade pip==18.1
14+
# - python -m pip install --upgrade setuptools==40.4.3
15+
- pip install -r mbed-os/requirements.txt
16+
117
script:
218
# Check that examples compile
319
- sed -n '/``` cpp/,${/```$/q;/```/d;p}' README.md > main.cpp &&
@@ -8,21 +24,3 @@ script:
824
PYTHONPATH=mbed-os python mbed-os/tools/make.py -t GCC_ARM -m K82F
925
--source=. --build=BUILD/K82F/GCC_ARM -j0 &&
1026
rm main.cpp
11-
12-
# Check that tests compile
13-
- rm -r BUILD && PYTHONPATH=mbed-os python mbed-os/tools/test.py
14-
-t GCC_ARM -m K82F --source=. --build=BUILD/TESTS/K82F/GCC_ARM -j0
15-
-n tests*
16-
17-
python:
18-
- "2.7"
19-
20-
install:
21-
# Get arm-none-eabi-gcc
22-
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
23-
- sudo apt-get update -qq
24-
- sudo apt-get install -qq gcc-arm-none-eabi --force-yes
25-
# Get dependencies
26-
- git clone https://github.com/armmbed/mbed-os.git
27-
# Install python dependencies
28-
- sudo pip install -r mbed-os/requirements.txt

I2CEEBlockDevice.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,8 @@ bd_size_t I2CEEBlockDevice::size() const
147147
{
148148
return _size;
149149
}
150+
151+
const char *I2CEEBlockDevice::get_type() const
152+
{
153+
return "I2CEE";
154+
}

I2CEEBlockDevice.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef MBED_I2CEEPROM_BLOCK_DEVICE_H
1717
#define MBED_I2CEEPROM_BLOCK_DEVICE_H
1818

19-
#include <mbed.h>
19+
#include "mbed.h"
2020
#include "BlockDevice.h"
2121

2222

@@ -156,6 +156,12 @@ class I2CEEBlockDevice : public BlockDevice {
156156
* @return Size of the underlying device in bytes
157157
*/
158158
virtual bd_size_t size() const;
159+
160+
/** Get the BlockDevice class type.
161+
*
162+
* @return A string representation of the BlockDevice class type.
163+
*/
164+
virtual const char *get_type() const;
159165

160166
private:
161167
I2C * _i2c;

0 commit comments

Comments
 (0)