Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid of multiple definition errors #41

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions tft_lib.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define __TFT_LIB_C__

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
Expand Down
19 changes: 12 additions & 7 deletions tft_lib.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#ifndef __TFT_LIB_H__
#define __TFT_LIB_H__
#ifndef __TFT_LIB_C__
#define DECLARE extern
#else
#define DECLARE
#endif

#include "fontx.h"

Expand Down Expand Up @@ -63,13 +68,13 @@ typedef struct {
} TFT_t;

// Driver dependent function
void (*DrawPixel)(TFT_t * dev, uint16_t x, uint16_t y, uint16_t color);
void (*DrawMultiPixels)(TFT_t * dev, uint16_t x, uint16_t y, uint16_t size, uint16_t * colors);
void (*DrawFillRect)(TFT_t * dev, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
void (*DisplayOff)(TFT_t * dev);
void (*DisplayOn)(TFT_t * dev);
void (*InversionOff)(TFT_t * dev);
void (*InversionOn)(TFT_t * dev);
DECLARE void (*DrawPixel)(TFT_t * dev, uint16_t x, uint16_t y, uint16_t color);
DECLARE void (*DrawMultiPixels)(TFT_t * dev, uint16_t x, uint16_t y, uint16_t size, uint16_t * colors);
DECLARE void (*DrawFillRect)(TFT_t * dev, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);
DECLARE void (*DisplayOff)(TFT_t * dev);
DECLARE void (*DisplayOn)(TFT_t * dev);
DECLARE void (*InversionOff)(TFT_t * dev);
DECLARE void (*InversionOn)(TFT_t * dev);

// Global function
void lcdDelay(int ms);
Expand Down