Sansa Connect: Make simulator compile. UI-sansaconnect.bmp by Martin Sägmüller (based on press image).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31102 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomasz Moń 2011-12-01 13:41:59 +00:00
parent f0bab2ff9a
commit 39f4408b63
5 changed files with 106 additions and 1 deletions

View File

@ -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);

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 KiB

View File

@ -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 */

View File

@ -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" }
};