diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_buffer.c')
-rw-r--r-- | apps/gui/skin_engine/skin_buffer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/gui/skin_engine/skin_buffer.c b/apps/gui/skin_engine/skin_buffer.c index 1a81f55ea8..3ad2efc634 100644 --- a/apps/gui/skin_engine/skin_buffer.c +++ b/apps/gui/skin_engine/skin_buffer.c | |||
@@ -34,14 +34,14 @@ | |||
34 | /* skin buffer management. | 34 | /* skin buffer management. |
35 | * This module is used to allocate space in a single global skin buffer for | 35 | * This module is used to allocate space in a single global skin buffer for |
36 | * tokens for both/all screens. | 36 | * tokens for both/all screens. |
37 | * | 37 | * |
38 | * This is mostly just copy/paste from firmware/buffer.c | 38 | * This is mostly just copy/paste from firmware/buffer.c |
39 | * | 39 | * |
40 | * | 40 | * |
41 | * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration, | 41 | * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration, |
42 | * both screens can use the whole buffer as they need; it's not split | 42 | * both screens can use the whole buffer as they need; it's not split |
43 | * between screens | 43 | * between screens |
44 | * | 44 | * |
45 | * Buffer can be allocated from either "end" of the global buffer. | 45 | * Buffer can be allocated from either "end" of the global buffer. |
46 | * items with unknown sizes get allocated from the start (0->) (data) | 46 | * items with unknown sizes get allocated from the start (0->) (data) |
47 | * items with known sizes get allocated from the end (<-buf_size) (tokens) | 47 | * items with known sizes get allocated from the end (<-buf_size) (tokens) |
@@ -49,7 +49,7 @@ | |||
49 | * |tokens skin1|images skin2|---SPACE---|data skin2|data skin1| | 49 | * |tokens skin1|images skin2|---SPACE---|data skin2|data skin1| |
50 | * Make sure to never start allocating from the beginning before letting us know | 50 | * Make sure to never start allocating from the beginning before letting us know |
51 | * how much was used. and RESPECT THE buf_free RETURN VALUES! | 51 | * how much was used. and RESPECT THE buf_free RETURN VALUES! |
52 | * | 52 | * |
53 | */ | 53 | */ |
54 | 54 | ||
55 | 55 | ||
@@ -71,7 +71,7 @@ | |||
71 | 71 | ||
72 | #ifdef HAVE_LCD_CHARCELLS | 72 | #ifdef HAVE_LCD_CHARCELLS |
73 | #define SKIN_BUFFER_SIZE (LCD_HEIGHT * LCD_WIDTH) * 64 + \ | 73 | #define SKIN_BUFFER_SIZE (LCD_HEIGHT * LCD_WIDTH) * 64 + \ |
74 | (WPS_MAX_TOKENS * sizeof(struct wps_token)) | 74 | (WPS_MAX_TOKENS * sizeof(struct wps_token)) |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | static unsigned char buffer[SKIN_BUFFER_SIZE]; | 77 | static unsigned char buffer[SKIN_BUFFER_SIZE]; |
@@ -87,7 +87,7 @@ void skin_buffer_init(void) | |||
87 | if (buffer == NULL) | 87 | if (buffer == NULL) |
88 | { | 88 | { |
89 | buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ | 89 | buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ |
90 | 90 | ||
91 | buffer = buffer_alloc(buf_size); | 91 | buffer = buffer_alloc(buf_size); |
92 | buffer_front = buffer; | 92 | buffer_front = buffer; |
93 | buffer_back = bufer + buf_size; | 93 | buffer_back = bufer + buf_size; |
@@ -124,16 +124,16 @@ void* skin_buffer_alloc(size_t size) | |||
124 | buffer_back -= size; | 124 | buffer_back -= size; |
125 | /* 32-bit aligned */ | 125 | /* 32-bit aligned */ |
126 | buffer_back = (void *)(((unsigned long)buffer_back) & ~3); | 126 | buffer_back = (void *)(((unsigned long)buffer_back) & ~3); |
127 | 127 | ||
128 | memset(buffer_back, 0, size); | 128 | memset(buffer_back, 0, size); |
129 | return buffer_back; | 129 | return buffer_back; |
130 | } | 130 | } |
131 | 131 | ||
132 | /* Get a pointer to the skin buffer and the count of how much is free | 132 | /* Get a pointer to the skin buffer and the count of how much is free |
133 | * used to do your own buffer management. | 133 | * used to do your own buffer management. |
134 | * Any memory used will be overwritten next time wps_buffer_alloc() | 134 | * Any memory used will be overwritten next time wps_buffer_alloc() |
135 | * is called unless skin_buffer_increment() is called first | 135 | * is called unless skin_buffer_increment() is called first |
136 | * | 136 | * |
137 | * This is from the start of the buffer, it is YOUR responsility to make | 137 | * This is from the start of the buffer, it is YOUR responsility to make |
138 | * sure you dont ever use more then *freespace, and bear in mind this will only | 138 | * sure you dont ever use more then *freespace, and bear in mind this will only |
139 | * be valid untill skin_buffer_alloc() is next called... | 139 | * be valid untill skin_buffer_alloc() is next called... |