Skip to content

add missing get_type() from BlockDevice #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
dist: xenial
language: python
python: 2.7

install:
# Get arm-none-eabi-gcc
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-arm-embedded
# Get dependencies
- git clone https://github.com/armmbed/mbed-os.git
# Install python dependencies
# - python -m pip install --upgrade pip==18.1
# - python -m pip install --upgrade setuptools==40.4.3
- pip install -r mbed-os/requirements.txt

script:
# Check that examples compile
- sed -n '/``` cpp/,${/```$/q;/```/d;p}' README.md > main.cpp &&
Expand All @@ -8,21 +24,3 @@ script:
PYTHONPATH=mbed-os python mbed-os/tools/make.py -t GCC_ARM -m K82F
--source=. --build=BUILD/K82F/GCC_ARM -j0 &&
rm main.cpp

# Check that tests compile
- rm -r BUILD && PYTHONPATH=mbed-os python mbed-os/tools/test.py
-t GCC_ARM -m K82F --source=. --build=BUILD/TESTS/K82F/GCC_ARM -j0
-n tests*

python:
- "2.7"

install:
# Get arm-none-eabi-gcc
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-arm-none-eabi --force-yes
# Get dependencies
- git clone https://github.com/armmbed/mbed-os.git
# Install python dependencies
- sudo pip install -r mbed-os/requirements.txt
5 changes: 5 additions & 0 deletions I2CEEBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@ bd_size_t I2CEEBlockDevice::size() const
{
return _size;
}

const char *I2CEEBlockDevice::get_type() const
{
return "I2CEE";
}
8 changes: 7 additions & 1 deletion I2CEEBlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef MBED_I2CEEPROM_BLOCK_DEVICE_H
#define MBED_I2CEEPROM_BLOCK_DEVICE_H

#include <mbed.h>
#include "mbed.h"
#include "BlockDevice.h"


Expand Down Expand Up @@ -156,6 +156,12 @@ class I2CEEBlockDevice : public BlockDevice {
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size() const;

/** Get the BlockDevice class type.
*
* @return A string representation of the BlockDevice class type.
*/
virtual const char *get_type() const;

private:
I2C * _i2c;
Expand Down