diff options
Diffstat (limited to 'Documentation/auxdisplay/cfag12864b-example.c')
-rw-r--r-- | Documentation/auxdisplay/cfag12864b-example.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentation/auxdisplay/cfag12864b-example.c index 2caeea5e4993..e7823ffb1ca0 100644 --- a/Documentation/auxdisplay/cfag12864b-example.c +++ b/Documentation/auxdisplay/cfag12864b-example.c | |||
@@ -62,7 +62,7 @@ unsigned char cfag12864b_buffer[CFAG12864B_SIZE]; | |||
62 | * Unable to open: return = -1 | 62 | * Unable to open: return = -1 |
63 | * Unable to mmap: return = -2 | 63 | * Unable to mmap: return = -2 |
64 | */ | 64 | */ |
65 | int cfag12864b_init(char *path) | 65 | static int cfag12864b_init(char *path) |
66 | { | 66 | { |
67 | cfag12864b_fd = open(path, O_RDWR); | 67 | cfag12864b_fd = open(path, O_RDWR); |
68 | if (cfag12864b_fd == -1) | 68 | if (cfag12864b_fd == -1) |
@@ -81,7 +81,7 @@ int cfag12864b_init(char *path) | |||
81 | /* | 81 | /* |
82 | * exit a cfag12864b framebuffer device | 82 | * exit a cfag12864b framebuffer device |
83 | */ | 83 | */ |
84 | void cfag12864b_exit(void) | 84 | static void cfag12864b_exit(void) |
85 | { | 85 | { |
86 | munmap(cfag12864b_mem, CFAG12864B_SIZE); | 86 | munmap(cfag12864b_mem, CFAG12864B_SIZE); |
87 | close(cfag12864b_fd); | 87 | close(cfag12864b_fd); |
@@ -90,7 +90,7 @@ void cfag12864b_exit(void) | |||
90 | /* | 90 | /* |
91 | * set (x, y) pixel | 91 | * set (x, y) pixel |
92 | */ | 92 | */ |
93 | void cfag12864b_set(unsigned char x, unsigned char y) | 93 | static void cfag12864b_set(unsigned char x, unsigned char y) |
94 | { | 94 | { |
95 | if (CFAG12864B_CHECK(x, y)) | 95 | if (CFAG12864B_CHECK(x, y)) |
96 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |= | 96 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |= |
@@ -100,7 +100,7 @@ void cfag12864b_set(unsigned char x, unsigned char y) | |||
100 | /* | 100 | /* |
101 | * unset (x, y) pixel | 101 | * unset (x, y) pixel |
102 | */ | 102 | */ |
103 | void cfag12864b_unset(unsigned char x, unsigned char y) | 103 | static void cfag12864b_unset(unsigned char x, unsigned char y) |
104 | { | 104 | { |
105 | if (CFAG12864B_CHECK(x, y)) | 105 | if (CFAG12864B_CHECK(x, y)) |
106 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &= | 106 | cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &= |
@@ -113,7 +113,7 @@ void cfag12864b_unset(unsigned char x, unsigned char y) | |||
113 | * Pixel off: return = 0 | 113 | * Pixel off: return = 0 |
114 | * Pixel on: return = 1 | 114 | * Pixel on: return = 1 |
115 | */ | 115 | */ |
116 | unsigned char cfag12864b_isset(unsigned char x, unsigned char y) | 116 | static unsigned char cfag12864b_isset(unsigned char x, unsigned char y) |
117 | { | 117 | { |
118 | if (CFAG12864B_CHECK(x, y)) | 118 | if (CFAG12864B_CHECK(x, y)) |
119 | if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] & | 119 | if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] & |
@@ -126,7 +126,7 @@ unsigned char cfag12864b_isset(unsigned char x, unsigned char y) | |||
126 | /* | 126 | /* |
127 | * not (x, y) pixel | 127 | * not (x, y) pixel |
128 | */ | 128 | */ |
129 | void cfag12864b_not(unsigned char x, unsigned char y) | 129 | static void cfag12864b_not(unsigned char x, unsigned char y) |
130 | { | 130 | { |
131 | if (cfag12864b_isset(x, y)) | 131 | if (cfag12864b_isset(x, y)) |
132 | cfag12864b_unset(x, y); | 132 | cfag12864b_unset(x, y); |
@@ -137,7 +137,7 @@ void cfag12864b_not(unsigned char x, unsigned char y) | |||
137 | /* | 137 | /* |
138 | * fill (set all pixels) | 138 | * fill (set all pixels) |
139 | */ | 139 | */ |
140 | void cfag12864b_fill(void) | 140 | static void cfag12864b_fill(void) |
141 | { | 141 | { |
142 | unsigned short i; | 142 | unsigned short i; |
143 | 143 | ||
@@ -148,7 +148,7 @@ void cfag12864b_fill(void) | |||
148 | /* | 148 | /* |
149 | * clear (unset all pixels) | 149 | * clear (unset all pixels) |
150 | */ | 150 | */ |
151 | void cfag12864b_clear(void) | 151 | static void cfag12864b_clear(void) |
152 | { | 152 | { |
153 | unsigned short i; | 153 | unsigned short i; |
154 | 154 | ||
@@ -162,7 +162,7 @@ void cfag12864b_clear(void) | |||
162 | * Pixel off: src[i] = 0 | 162 | * Pixel off: src[i] = 0 |
163 | * Pixel on: src[i] > 0 | 163 | * Pixel on: src[i] > 0 |
164 | */ | 164 | */ |
165 | void cfag12864b_format(unsigned char * matrix) | 165 | static void cfag12864b_format(unsigned char * matrix) |
166 | { | 166 | { |
167 | unsigned char i, j, n; | 167 | unsigned char i, j, n; |
168 | 168 | ||
@@ -182,7 +182,7 @@ void cfag12864b_format(unsigned char * matrix) | |||
182 | /* | 182 | /* |
183 | * blit buffer to lcd | 183 | * blit buffer to lcd |
184 | */ | 184 | */ |
185 | void cfag12864b_blit(void) | 185 | static void cfag12864b_blit(void) |
186 | { | 186 | { |
187 | memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE); | 187 | memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE); |
188 | } | 188 | } |
@@ -194,11 +194,10 @@ void cfag12864b_blit(void) | |||
194 | */ | 194 | */ |
195 | 195 | ||
196 | #include <stdio.h> | 196 | #include <stdio.h> |
197 | #include <string.h> | ||
198 | 197 | ||
199 | #define EXAMPLES 6 | 198 | #define EXAMPLES 6 |
200 | 199 | ||
201 | void example(unsigned char n) | 200 | static void example(unsigned char n) |
202 | { | 201 | { |
203 | unsigned short i, j; | 202 | unsigned short i, j; |
204 | unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT]; | 203 | unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT]; |