diff options
-rw-r--r-- | firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c | 2 | ||||
-rw-r--r-- | firmware/target/hosted/sdl/sim-ui-defines.h | 7 | ||||
-rw-r--r-- | uisimulator/bitmaps/UI-sansaconnect.bmp | bin | 0 -> 766748 bytes | |||
-rw-r--r-- | uisimulator/buttonmap/SOURCES | 2 | ||||
-rw-r--r-- | uisimulator/buttonmap/sansa-connect.c | 96 |
5 files changed, 106 insertions, 1 deletions
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c index 62a25e879f..870aa523cf 100644 --- a/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c +++ b/firmware/target/arm/tms320dm320/sansa-connect/avr-sansaconnect.c @@ -254,7 +254,7 @@ static void spi_txrx(unsigned char *buf_tx, unsigned char *buf_rx, int n) if (buf_rx != NULL) buf_rx[i] = rxdata & 0xFF; - //udelay(100); + udelay(100); } select_hid(false); diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h index 096908bb85..b5667ec72a 100644 --- a/firmware/target/hosted/sdl/sim-ui-defines.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h @@ -424,6 +424,13 @@ #define UI_LCD_POSX 64 #define UI_LCD_POSY 127 +#elif defined(SANSA_CONNECT) +#define UI_TITLE "Sansa Connect" +#define UI_WIDTH 371 /* width of GUI window */ +#define UI_HEIGHT 687 /* height of GUI window */ +#define UI_LCD_POSX 68 +#define UI_LCD_POSY 77 + #elif defined(APPLICATION) #define UI_TITLE "Rockbox" #define UI_LCD_POSX 0 diff --git a/uisimulator/bitmaps/UI-sansaconnect.bmp b/uisimulator/bitmaps/UI-sansaconnect.bmp Binary files differnew file mode 100644 index 0000000000..90e524dcb6 --- /dev/null +++ b/uisimulator/bitmaps/UI-sansaconnect.bmp diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index 4a2c8ff2e1..7213d1cff3 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES @@ -67,5 +67,7 @@ mpio-hd200.c mpio-hd300.c #elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD sansa-fuzeplus.c +#elif CONFIG_KEYPAD == SANSA_CONNECT_PAD +sansa-connect.c #endif #endif /* SIMULATOR */ diff --git a/uisimulator/buttonmap/sansa-connect.c b/uisimulator/buttonmap/sansa-connect.c new file mode 100644 index 0000000000..5e65544ab0 --- /dev/null +++ b/uisimulator/buttonmap/sansa-connect.c @@ -0,0 +1,96 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: $ + * + * Copyright (C) 2011 by Tomasz Moń + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + + +#include <SDL.h> +#include "button.h" +#include "buttonmap.h" + +int key_to_button(int keyboard_button) +{ + int new_btn = BUTTON_NONE; + switch (keyboard_button) + { + case SDLK_KP4: + case SDLK_LEFT: + new_btn = BUTTON_LEFT; + break; + case SDLK_KP6: + case SDLK_RIGHT: + new_btn = BUTTON_RIGHT; + break; + case SDLK_KP8: + case SDLK_UP: + new_btn = BUTTON_UP; + break; + case SDLK_KP2: + case SDLK_DOWN: + new_btn = BUTTON_DOWN; + break; + case SDLK_KP7: + new_btn = BUTTON_PREV; + break; + case SDLK_PAGEUP: + case SDLK_KP9: + new_btn = BUTTON_NEXT; + break; + case SDLK_KP0: + new_btn = BUTTON_POWER; + break; + case SDLK_KP5: + case SDLK_SPACE: + case SDLK_KP_ENTER: + case SDLK_RETURN: + new_btn = BUTTON_SELECT; + break; + case SDLK_KP_PLUS: + new_btn = BUTTON_VOL_UP; + break; + case SDLK_KP_MINUS: + new_btn = BUTTON_VOL_DOWN; + break; + case SDL_BUTTON_WHEELDOWN: + case SDLK_KP3: + new_btn = BUTTON_SCROLL_FWD; + break; + case SDL_BUTTON_WHEELUP: + case SDLK_KP1: + new_btn = BUTTON_SCROLL_BACK; + break; + } + return new_btn; +} + +struct button_map bm[] = { + { SDLK_UP, 191, 505, 36, "Up" }, + { SDLK_DOWN, 191, 630, 36, "Down" }, + { SDLK_LEFT, 130, 568, 36, "Left" }, + { SDLK_RIGHT, 256, 568, 36, "Right" }, + { SDLK_KP7, 107, 443, 40, "Prev" }, + { SDLK_KP9, 271, 443, 40, "Next" }, + { SDLK_KP5, 191, 568, 36, "Select" }, + { SDLK_KP0, 220, 43, 30, "Power" }, + { SDLK_KP3, 231, 520, 20, "Scroll Fwd" }, + { SDLK_KP1, 149, 520, 20, "Scroll Back" }, + { SDLK_KP_MINUS, 3, 377, 50, "Volume -" }, + { SDLK_KP_PLUS, 6, 175, 50, "Volume +" }, + { 0, 0, 0, 0, "None" } +}; |