diff options
-rw-r--r-- | firmware/export/config-mini2440.h | 19 | ||||
-rw-r--r-- | uisimulator/sdl/UI-mini2440.bmp | bin | 0 -> 577320 bytes | |||
-rw-r--r-- | uisimulator/sdl/button.c | 35 | ||||
-rw-r--r-- | uisimulator/sdl/uisdl.h | 6 |
4 files changed, 52 insertions, 8 deletions
diff --git a/firmware/export/config-mini2440.h b/firmware/export/config-mini2440.h index 83505d8994..557f865454 100644 --- a/firmware/export/config-mini2440.h +++ b/firmware/export/config-mini2440.h | |||
@@ -68,6 +68,10 @@ | |||
68 | /* But the 3.5" LCD touch screen does not support brightness*/ | 68 | /* But the 3.5" LCD touch screen does not support brightness*/ |
69 | #define HAVE_BACKLIGHT | 69 | #define HAVE_BACKLIGHT |
70 | #define HAVE_BACKLIGHT_BRIGHTNESS | 70 | #define HAVE_BACKLIGHT_BRIGHTNESS |
71 | /* Main LCD backlight brightness range and defaults */ | ||
72 | #define MIN_BRIGHTNESS_SETTING 1 /* 0.5 mA */ | ||
73 | #define MAX_BRIGHTNESS_SETTING 12 /* 32 mA */ | ||
74 | #define DEFAULT_BRIGHTNESS_SETTING 10 /* 16 mA */ | ||
71 | 75 | ||
72 | /* Keypad */ | 76 | /* Keypad */ |
73 | #define CONFIG_KEYPAD MINI2440_PAD | 77 | #define CONFIG_KEYPAD MINI2440_PAD |
@@ -93,11 +97,7 @@ | |||
93 | #define BATTERY_CAPACITY_INC 100 /* capacity increment */ | 97 | #define BATTERY_CAPACITY_INC 100 /* capacity increment */ |
94 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 98 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
95 | 99 | ||
96 | /* USB */ | ||
97 | /* TODO:#define HAVE_USBSTACK */ | ||
98 | #define USB_NONE | ||
99 | 100 | ||
100 | #define HAVE_SERIAL | ||
101 | 101 | ||
102 | /***************************************************************************/ | 102 | /***************************************************************************/ |
103 | /* Application Config */ | 103 | /* Application Config */ |
@@ -134,16 +134,19 @@ | |||
134 | #define MCK_FREQ (CPU_FREQ/4) | 134 | #define MCK_FREQ (CPU_FREQ/4) |
135 | #define SLOW_CLOCK 32768 | 135 | #define SLOW_CLOCK 32768 |
136 | 136 | ||
137 | /* Main LCD backlight brightness range and defaults */ | 137 | |
138 | #define MIN_BRIGHTNESS_SETTING 1 /* 0.5 mA */ | ||
139 | #define MAX_BRIGHTNESS_SETTING 12 /* 32 mA */ | ||
140 | #define DEFAULT_BRIGHTNESS_SETTING 10 /* 16 mA */ | ||
141 | /* Define this if your LCD can set contrast */ | 138 | /* Define this if your LCD can set contrast */ |
142 | #define HAVE_LCD_CONTRAST | 139 | #define HAVE_LCD_CONTRAST |
143 | #define MIN_CONTRAST_SETTING 0 | 140 | #define MIN_CONTRAST_SETTING 0 |
144 | #define MAX_CONTRAST_SETTING 63 | 141 | #define MAX_CONTRAST_SETTING 63 |
145 | #define DEFAULT_CONTRAST_SETTING 47 /* Match boot contrast */ | 142 | #define DEFAULT_CONTRAST_SETTING 47 /* Match boot contrast */ |
146 | 143 | ||
144 | /* USB */ | ||
145 | /* TODO:#define HAVE_USBSTACK */ | ||
146 | #define USB_NONE | ||
147 | |||
148 | #define HAVE_SERIAL | ||
149 | |||
147 | /* Hardware controlled charging with monitoring */ | 150 | /* Hardware controlled charging with monitoring */ |
148 | #define CONFIG_CHARGING CHARGING_MONITOR | 151 | #define CONFIG_CHARGING CHARGING_MONITOR |
149 | /*#define POWER_INPUT_BATTERY 0*/ | 152 | /*#define POWER_INPUT_BATTERY 0*/ |
diff --git a/uisimulator/sdl/UI-mini2440.bmp b/uisimulator/sdl/UI-mini2440.bmp new file mode 100644 index 0000000000..556026a5ca --- /dev/null +++ b/uisimulator/sdl/UI-mini2440.bmp | |||
Binary files differ | |||
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index f8889bafb8..3a6b9ce09f 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c | |||
@@ -1190,6 +1190,41 @@ void button_event(int key, bool pressed) | |||
1190 | case SDLK_KP_PLUS: | 1190 | case SDLK_KP_PLUS: |
1191 | new_btn = BUTTON_REC; | 1191 | new_btn = BUTTON_REC; |
1192 | break; | 1192 | break; |
1193 | #elif CONFIG_KEYPAD == MINI2440_PAD | ||
1194 | case SDLK_LEFT: | ||
1195 | new_btn = BUTTON_LEFT; | ||
1196 | break; | ||
1197 | case SDLK_RIGHT: | ||
1198 | new_btn = BUTTON_RIGHT; | ||
1199 | break; | ||
1200 | case SDLK_UP: | ||
1201 | new_btn = BUTTON_UP; | ||
1202 | break; | ||
1203 | case SDLK_DOWN: | ||
1204 | new_btn = BUTTON_DOWN; | ||
1205 | break; | ||
1206 | case SDLK_F8: | ||
1207 | case SDLK_ESCAPE: | ||
1208 | new_btn = BUTTON_POWER; | ||
1209 | break; | ||
1210 | case SDLK_KP_ENTER: | ||
1211 | case SDLK_RETURN: | ||
1212 | case SDLK_a: | ||
1213 | new_btn = BUTTON_A; | ||
1214 | break; | ||
1215 | case SDLK_SPACE: | ||
1216 | new_btn = BUTTON_SELECT; | ||
1217 | break; | ||
1218 | case SDLK_KP_PERIOD: | ||
1219 | case SDLK_INSERT: | ||
1220 | new_btn = BUTTON_MENU; | ||
1221 | break; | ||
1222 | case SDLK_KP_PLUS: | ||
1223 | new_btn = BUTTON_VOL_UP; | ||
1224 | break; | ||
1225 | case SDLK_KP_MINUS: | ||
1226 | new_btn = BUTTON_VOL_DOWN; | ||
1227 | break; | ||
1193 | #else | 1228 | #else |
1194 | #error No keymap defined! | 1229 | #error No keymap defined! |
1195 | #endif /* CONFIG_KEYPAD */ | 1230 | #endif /* CONFIG_KEYPAD */ |
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index 8e60735d05..911f2a3f50 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h | |||
@@ -353,6 +353,12 @@ | |||
353 | #define UI_LCD_POSX 124 /* x position of lcd */ | 353 | #define UI_LCD_POSX 124 /* x position of lcd */ |
354 | #define UI_LCD_POSY 42 /* y position of lcd */ | 354 | #define UI_LCD_POSY 42 /* y position of lcd */ |
355 | 355 | ||
356 | #elif defined(MINI2440) | ||
357 | #define UI_TITLE "Mini2440" | ||
358 | #define UI_WIDTH 441 /* width of GUI window */ | ||
359 | #define UI_HEIGHT 436 /* height of GUI window */ | ||
360 | #define UI_LCD_POSX 148 /* x position of lcd */ | ||
361 | #define UI_LCD_POSY 50 /* y position of lcd */ | ||
356 | #else | 362 | #else |
357 | #error no UI defines | 363 | #error no UI defines |
358 | #endif | 364 | #endif |