Skip to content
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
6 changes: 3 additions & 3 deletions src/allocateMem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ std::size_t deviceBuffer[MF_MAX_DEVICEMEM] = {0};
uint16_t nextPointer = 0;

#if defined (ARDUINO_ARCH_AVR)
uint8_t *allocateMemory(uint8_t size)
uint8_t *allocateMemory(uint16_t size)
#else
std::size_t *allocateMemory(uint8_t size)
std::size_t *allocateMemory(uint16_t size)
#endif
{
uint16_t actualPointer = nextPointer;
Expand Down Expand Up @@ -49,7 +49,7 @@ uint16_t GetAvailableMemory()
return MF_MAX_DEVICEMEM - nextPointer;
}

bool FitInMemory(uint8_t size)
bool FitInMemory(uint16_t size)
{
if (nextPointer + size > MF_MAX_DEVICEMEM)
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/allocateMem.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include <new>

#if defined (ARDUINO_ARCH_AVR)
uint8_t *allocateMemory(uint8_t size);
uint8_t *allocateMemory(uint16_t size);
#else
std::size_t *allocateMemory(uint8_t size);
std::size_t *allocateMemory(uint16_t size);
#endif

void ClearMemory();
uint16_t GetAvailableMemory();
bool FitInMemory(uint8_t size);
bool FitInMemory(uint16_t size);

// allocatemem.h