1
0
Fork 0
forked from len0rd/rockbox

adjustments for Neo

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4130 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2003-12-12 13:23:33 +00:00
parent 503ce1bc04
commit 006b2c1c25
4 changed files with 89 additions and 4 deletions

View file

@ -577,6 +577,7 @@ static void ata_thread(void)
} }
queue_wait(&ata_queue, &ev); queue_wait(&ata_queue, &ev);
switch ( ev.id ) { switch ( ev.id ) {
#ifndef USB_NONE
case SYS_USB_CONNECTED: case SYS_USB_CONNECTED:
if (poweroff) { if (poweroff) {
mutex_lock(&ata_mtx); mutex_lock(&ata_mtx);
@ -593,7 +594,7 @@ static void ata_thread(void)
/* Wait until the USB cable is extracted again */ /* Wait until the USB cable is extracted again */
usb_wait_for_disconnect(&ata_queue); usb_wait_for_disconnect(&ata_queue);
break; break;
#endif
case Q_SLEEP: case Q_SLEEP:
last_disk_activity = current_tick - sleep_timeout + (HZ/2); last_disk_activity = current_tick - sleep_timeout + (HZ/2);
break; break;

View file

@ -328,4 +328,38 @@ static int button_read(void)
return btn; return btn;
} }
#elif HAVE_NEO_KEYPAD
static bool mStation = false;
void button_init(void)
{
/* set port pins as input */
PAIOR &= ~0x4000; //PA14 for stop button
queue_init(&button_queue);
tick_add_task(button_tick);
last_keypress = current_tick;
}
int button_read(void)
{
int btn=BUTTON_NONE;
btn|=((~PCDR)&0xFF);
/* mStation does not have a stop button and this floods the button queue
with stops if used on a mStation */
if (!mStation)
btn|=((~(PADR>>6))&0x100);
return btn;
}
/* This function adds a button press event to the button queue, and this
really isn't anything Neo-specific but might be subject for adding to
the generic button driver */
int button_add(unsigned int button)
{
queue_post(&button_queue,button,NULL);
return 1;
}
#endif #endif

View file

@ -105,7 +105,7 @@ static char pattern_size; /* Last pattern, 3 for old LCD, 7 for new LCD */
static bool new_lcd; static bool new_lcd;
extern unsigned short *lcd_ascii; unsigned short *lcd_ascii;
static char lcd_contrast_set; static char lcd_contrast_set;
static char lcd_cram; static char lcd_cram;
static char lcd_pram; static char lcd_pram;
@ -130,7 +130,9 @@ static void lcd_free_pat(int map_ch)
substitute_char=lcd_player_extended_lcd_to_rocklatin1[map_ch]; substitute_char=lcd_player_extended_lcd_to_rocklatin1[map_ch];
/* TODO: use a define for the screen width! */
for (x=0; x<11; x++) { for (x=0; x<11; x++) {
/* TODO: use a define for the screen height! */
for (y=0; y<2; y++) { for (y=0; y<2; y++) {
if (map_ch==lcd_ascii[buffer_xlcd[x][y]]-512) { if (map_ch==lcd_ascii[buffer_xlcd[x][y]]-512) {
buffer_xlcd[x][y]=substitute_char; buffer_xlcd[x][y]=substitute_char;
@ -480,7 +482,11 @@ void lcd_set_contrast(int val)
void lcd_init (void) void lcd_init (void)
{ {
#ifdef HAVE_NEO_LCD
new_lcd = true;
#else
new_lcd = has_new_lcd(); new_lcd = has_new_lcd();
#endif
memset(extended_chars_mapped, NO_CHAR, sizeof(extended_chars_mapped)); memset(extended_chars_mapped, NO_CHAR, sizeof(extended_chars_mapped));
memset(extended_pattern_content, NO_CHAR,sizeof(extended_pattern_content)); memset(extended_pattern_content, NO_CHAR,sizeof(extended_pattern_content));
memset(extended_pattern_usage, 0, sizeof(extended_pattern_usage)); memset(extended_pattern_usage, 0, sizeof(extended_pattern_usage));
@ -491,7 +497,7 @@ void lcd_init (void)
lcd_cram = NEW_LCD_CRAM; lcd_cram = NEW_LCD_CRAM;
lcd_pram = NEW_LCD_PRAM; lcd_pram = NEW_LCD_PRAM;
lcd_iram = NEW_LCD_IRAM; lcd_iram = NEW_LCD_IRAM;
pattern_size=7; /* Last pattern, 3 for old LCD, 7 for new LCD */ pattern_size=7; /* Last pattern, 7 for new LCD */
} }
else { else {
lcd_ascii = old_lcd_rocklatin1_to_xlcd; lcd_ascii = old_lcd_rocklatin1_to_xlcd;
@ -499,7 +505,7 @@ void lcd_init (void)
lcd_cram = OLD_LCD_CRAM; lcd_cram = OLD_LCD_CRAM;
lcd_pram = OLD_LCD_PRAM; lcd_pram = OLD_LCD_PRAM;
lcd_iram = OLD_LCD_IRAM; lcd_iram = OLD_LCD_IRAM;
pattern_size=3; /* Last pattern, 3 for old LCD, 7 for new LCD */ pattern_size=3; /* Last pattern, 3 for old LCD */
} }
lcd_set_contrast(lcd_default_contrast()); lcd_set_contrast(lcd_default_contrast());
@ -719,4 +725,46 @@ static void scroll_thread(void)
} }
} }
#ifdef HAVE_NEO_LCD
/*
* Function use by the Neo code, but could/should be made a generic one.
*/
void lcd_cursor(int x, int y)
{
/* If we make sure the display size is setup with proper defines in the
config-*.h files, this should work on all displays */
if ((cursor.y_pos==y && cursor.x_pos==x) ||
x>=20 ||
y>3 ||
x<0 ||
y<0) {
DEBUGF("ignoring request for cursor to %d,%d - currently %d,%d\n",
x,y,cursor.x_pos,cursor.y_pos);
return;
}
char value=0;
cursor.y_pos=y;
cursor.x_pos=x;
switch (y) {
case 0:
value=0x80|x;
break;
case 1:
value=0x80|(x+0x40);
break;
case 2:
value=0x80|(x+0x14);
break;
case 3:
value=0x80|(x+0x54);
break;
}
lcd_write(true,value);
}
#endif
#endif /* HAVE_LCD_CHARCELLS */ #endif /* HAVE_LCD_CHARCELLS */

View file

@ -91,6 +91,7 @@ int remote_control_rx(void)
} }
else else
{ {
#ifndef HAVE_NEO_KEYPAD /* This needs to be fixed for Neo */
switch (btn) switch (btn)
{ {
case STOP: case STOP:
@ -126,6 +127,7 @@ int remote_control_rx(void)
last_valid_button = BUTTON_NONE; last_valid_button = BUTTON_NONE;
break; break;
} }
#endif
} }
} }
else else