mirror of
https://github.com/RobTillaart/I2C_EEPROM.git
synced 2026-10-26 22:10:15 +00:00
initial arduino-ci
This commit is contained in:
1 parent
74eec4b960
commit
eefb18b923
5 files changed
+101
-8
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
compile:
|
||||||
|
# Choosing to run compilation tests on 2 different Arduino platforms
|
||||||
|
platforms:
|
||||||
|
- uno
|
||||||
|
- leonardo
|
||||||
|
- due
|
||||||
|
- zero
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: Arduino CI
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
arduino_ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: Arduino-CI/action@master
|
||||||
|
# Arduino-CI/action@v0.1.1
|
||||||
@@ -60,7 +60,6 @@ public:
|
|||||||
|
|
||||||
int determineSize();
|
int determineSize();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t _deviceAddress;
|
uint8_t _deviceAddress;
|
||||||
uint32_t _lastWrite; // for waitEEReady
|
uint32_t _lastWrite; // for waitEEReady
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
[](https://github.com/marketplace/actions/arduino_ci)
|
||||||
|
[](https://github.com/RobTillaart/I2C_EEPROM/blob/master/LICENSE)
|
||||||
|
[](https://github.com/RobTillaart/I2C_EEPROM/releases)
|
||||||
|
|
||||||
# I2C_EEPROM
|
# I2C_EEPROM
|
||||||
|
|
||||||
Arduino Library for external I2C EEPROM - 24LC256, 24LC64
|
Arduino Library for external I2C EEPROM - 24LC256, 24LC64
|
||||||
@@ -8,13 +13,14 @@ Library to access external I2C EEPROM.
|
|||||||
|
|
||||||
The interface is pretty straightforward
|
The interface is pretty straightforward
|
||||||
|
|
||||||
* readByte - read a single byte from a given address
|
- **begin()** constructor
|
||||||
* writeByte
|
- **begin(sda, scl)** constructor for ESP32
|
||||||
* setBlock
|
- **writeByte(address, value)** write a single byte
|
||||||
* readBlock
|
- **writeBlock(address, buffer, length)**
|
||||||
* writeBlock
|
- **setBlock(address, value, length)** e.g. use to clear I2C EEPROM
|
||||||
* determineSize
|
- **readByte(address)** - read a single byte from a given address
|
||||||
|
- **readBlock(address, buffer, length)**
|
||||||
|
- **determineSize()**
|
||||||
|
|
||||||
|
|
||||||
## Limitation
|
## Limitation
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
//
|
||||||
|
// FILE: unit_test_001.cpp
|
||||||
|
// AUTHOR: Rob Tillaart
|
||||||
|
// DATE: 2020-12-22
|
||||||
|
// PURPOSE: unit tests for the I2C_EEPROM library
|
||||||
|
// https://github.com/RobTillaart/
|
||||||
|
// https://github.com/Arduino-CI/arduino_ci/blob/master/REFERENCE.md
|
||||||
|
//
|
||||||
|
|
||||||
|
// supported assertions
|
||||||
|
// https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/unittest/Assertion.h#L33-L42
|
||||||
|
// ----------------------------
|
||||||
|
// assertEqual(expected, actual)
|
||||||
|
// assertNotEqual(expected, actual)
|
||||||
|
// assertLess(expected, actual)
|
||||||
|
// assertMore(expected, actual)
|
||||||
|
// assertLessOrEqual(expected, actual)
|
||||||
|
// assertMoreOrEqual(expected, actual)
|
||||||
|
// assertTrue(actual)
|
||||||
|
// assertFalse(actual)
|
||||||
|
// assertNull(actual)
|
||||||
|
// assertNotNull(actual)
|
||||||
|
|
||||||
|
#include <ArduinoUnitTests.h>
|
||||||
|
|
||||||
|
#define assertEqualFloat(arg1, arg2, arg3) assertOp("assertEqualFloat", "expected", fabs(arg1 - arg2), compareLessOrEqual, "<=", "actual", arg3)
|
||||||
|
#define assertEqualINF(arg) assertOp("assertEqualINF", "expected", INFINITY, compareEqual, "==", "actual", arg)
|
||||||
|
#define assertEqualNAN(arg) assertOp("assertEqualNAN", "expected", true, compareEqual, "==", "actual", isnan(arg))
|
||||||
|
|
||||||
|
|
||||||
|
#include "Arduino.h"
|
||||||
|
#include "I2C_eeprom.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
unittest_setup()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
unittest_teardown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
unittest(test_new_operator)
|
||||||
|
{
|
||||||
|
assertEqualINF(exp(800));
|
||||||
|
assertEqualINF(0.0/0.0);
|
||||||
|
assertEqualINF(42);
|
||||||
|
|
||||||
|
assertEqualNAN(INFINITY - INFINITY);
|
||||||
|
assertEqualNAN(0.0/0.0);
|
||||||
|
assertEqualNAN(42);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
unittest(test_constructor)
|
||||||
|
{
|
||||||
|
I2C_eeprom EE(48);
|
||||||
|
EE.begin();
|
||||||
|
|
||||||
|
|
||||||
|
assertEqual(1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
unittest_main()
|
||||||
|
|
||||||
|
// --------
|
||||||
Reference in new issue
Block a user