Skip to content

Commit 664040e

Browse files
committed
Get the "calloc" function to work across different processors.
1 parent 0227dd8 commit 664040e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/SparkFun_Alphanumeric_Display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ bool HT16K33::defineChar(uint8_t displayChar, uint16_t segmentsToTurnOn)
679679
uint16_t characterPosition = displayChar - '!' + 1;
680680

681681
//Create a new character definition
682-
struct CharDef * pNewCharDef = calloc(1, sizeof(CharDef));
682+
struct CharDef * pNewCharDef = (CharDef *)calloc(1, sizeof(CharDef));
683683

684684
//Set the position to the table index
685685
pNewCharDef -> position = characterPosition;

src/SparkFun_Alphanumeric_Display.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Distributed as-is; no warranty is given.
2626

2727
#include <Arduino.h>
2828
#include <Wire.h>
29+
#include <stdio.h>
30+
#include <stdlib.h>
2931

3032
#define DEFAULT_ADDRESS 0x70 //Default I2C address when A0, A1 are floating
3133
// #define DEV_ID 0x12 //Device ID that I just made up

0 commit comments

Comments
 (0)