Skip to content

Commit

Permalink
Merge pull request #148 from 107-systems/o1heap
Browse files Browse the repository at this point in the history
Update o1heap to latest version (v2.1.0)
  • Loading branch information
aentinger committed Jun 14, 2022
2 parents 63618b5 + f78d297 commit 90d75f1
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build/
.vscode/
4 changes: 2 additions & 2 deletions src/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <memory>
#include <functional>

#include "ArduinoO1Heap.hpp"
#include "Types.h"
#include "O1Heap.hpp"

#include "libcanard/canard.h"

Expand Down Expand Up @@ -73,7 +73,7 @@ class Node
private:

static size_t constexpr LIBCANARD_O1HEAP_SIZE = 4096;
typedef ArduinoO1Heap<LIBCANARD_O1HEAP_SIZE> O1HeapLibcanard;
typedef O1Heap<LIBCANARD_O1HEAP_SIZE> O1HeapLibcanard;

typedef struct
{
Expand Down
6 changes: 3 additions & 3 deletions src/ArduinoO1Heap.hpp → src/O1Heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
**************************************************************************************/

template <size_t HEAP_SIZE>
class ArduinoO1Heap
class O1Heap
{
public:

ArduinoO1Heap();
O1Heap();


void * allocate(size_t const amount);
Expand All @@ -41,6 +41,6 @@ class ArduinoO1Heap
* TEMPLATE SOURCE
**************************************************************************************/

#include "ArduinoO1Heap.ipp"
#include "O1Heap.ipp"

#endif /* ARDUINO_O1_HEAP_HPP_ */
8 changes: 4 additions & 4 deletions src/ArduinoO1Heap.ipp → src/O1Heap.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
**************************************************************************************/

template <size_t HEAP_SIZE>
ArduinoO1Heap<HEAP_SIZE>::ArduinoO1Heap()
: _o1heap_ins{o1heapInit(_base, HEAP_SIZE, nullptr, nullptr)}
O1Heap<HEAP_SIZE>::O1Heap()
: _o1heap_ins{o1heapInit(_base, HEAP_SIZE)}
{

}
Expand All @@ -21,13 +21,13 @@ ArduinoO1Heap<HEAP_SIZE>::ArduinoO1Heap()
**************************************************************************************/

template <size_t HEAP_SIZE>
void * ArduinoO1Heap<HEAP_SIZE>::allocate(size_t const amount)
void * O1Heap<HEAP_SIZE>::allocate(size_t const amount)
{
return o1heapAllocate(_o1heap_ins, amount);
}

template <size_t HEAP_SIZE>
void ArduinoO1Heap<HEAP_SIZE>::free(void * const pointer)
void O1Heap<HEAP_SIZE>::free(void * const pointer)
{
o1heapFree(_o1heap_ins, pointer);
}
Loading

0 comments on commit 90d75f1

Please sign in to comment.