#include "ST7565.h"
#include "ST7565/glcdfont.h"
#include "Kernel.h"
-#include "ahbmalloc.h"
+#include "platform_memory.h"
//definitions for lcd
#define LCDWIDTH 128
// reverse display
this->reversed= THEKERNEL->config->value(panel_checksum, reverse_checksum)->by_default(false)->as_bool();
- framebuffer= (uint8_t *)ahbmalloc(FB_SIZE, AHB_BANK_0); // grab some memoery from USB_RAM
+ framebuffer= (uint8_t *)AHB0.alloc(FB_SIZE); // grab some memoery from USB_RAM
if(framebuffer == NULL) {
THEKERNEL->streams->printf("Not enough memory available for frame buffer");
}
}
ST7565::~ST7565() {
- //delete this->spi;
+ delete this->spi;
+ AHB0.dealloc(framebuffer);
}
//send commands to lcd
#include "RrdGlcd.h"
-#include "ahbmalloc.h"
+#include "platform_memory.h"
static const uint8_t font5x8[] = {
// 5x8 font each byte is consecutive x bits left aligned then each subsequent byte is Y 8 bytes per character
//chip select
this->cs= cs;
this->cs.set(0);
- fb= (uint8_t *)ahbmalloc(FB_SIZE, AHB_BANK_0); // grab some memoery from USB_RAM
+ fb= (uint8_t *)AHB0.alloc(FB_SIZE); // grab some memoery from USB_RAM
if(fb == NULL) {
THEKERNEL->streams->printf("Not enough memory available for frame buffer");
}
RrdGlcd::~RrdGlcd() {
delete this->spi;
- ahbfree(fb, FB_SIZE);
+ AHB0.dealloc(fb);
}
void RrdGlcd::setFrequency(int freq) {
#include "modules/tools/temperaturecontrol/TemperatureControlPublicAccess.h"
#include "modules/robot/RobotPublicAccess.h"
#include "NetworkPublicAccess.h"
+#include "platform_memory.h"
extern unsigned int g_maximumHeapAddress;
stream->printf("Unused Heap: %lu bytes\r\n", m);
heapWalk(stream, verbose);
+
+ stream->printf("Free AHB0: %lu, AHB1: %lu\n", AHB0.free(), AHB1.free());
}
static uint32_t getDeviceType()