diff --git a/devLib/lcd.c b/devLib/lcd.c index 897ab57..a48c4da 100644 --- a/devLib/lcd.c +++ b/devLib/lcd.c @@ -498,3 +498,19 @@ int lcdInit (const int rows, const int cols, const int bits, return lcdFd ; } + + +/* + * lcdFree: + * Free a LCD handle. + ********************************************************************************* + */ + +void lcdFree (const int fd) +{ + if ((fd >= 0) && (fd < MAX_LCDS)) + { + free(lcds[fd]); + lcds[fd] = NULL; + } +} diff --git a/devLib/lcd.h b/devLib/lcd.h index c78d3bc..b9244d1 100644 --- a/devLib/lcd.h +++ b/devLib/lcd.h @@ -47,6 +47,8 @@ extern int lcdInit (const int rows, const int cols, const int bits, const int d0, const int d1, const int d2, const int d3, const int d4, const int d5, const int d6, const int d7); +extern void lcdFree (const int fd); + #ifdef __cplusplus } #endif