[mips]
- libsys multitarget - apps multitarget git-svn-id: http://moon:8086/svn/mips@67 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+12
-9
@@ -5,12 +5,14 @@
|
||||
#include <sys/times.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define CPU_FREQ_HZ 100000000
|
||||
#include <console.h>
|
||||
#include "libsys.h"
|
||||
#include "irq.h"
|
||||
#include "mips_gfx.h"
|
||||
#include "mips_ps2.h"
|
||||
#include "libsys/console.h"
|
||||
|
||||
#define PS2_NUM_IF 2
|
||||
char buffer[16384];
|
||||
char * volatile pPtr_r;
|
||||
char * volatile pPtr_w;
|
||||
@@ -21,6 +23,7 @@ static gfx_t gfx;
|
||||
static volatile int _g_posx, _g_posy;
|
||||
static volatile g_btn_l, g_btn_r;
|
||||
static volatile uint32_t g_color;
|
||||
static int ps2_fd[PS2_NUM_IF];
|
||||
|
||||
// -------------------------------------------------------------
|
||||
void handler0(void)
|
||||
@@ -82,15 +85,15 @@ void handler5(void)
|
||||
void handler6(void)
|
||||
{
|
||||
int p, i;
|
||||
ps2_if_t *pIF;
|
||||
ps2_if_t const *pIF;
|
||||
uint8_t mouse_rsp[3];
|
||||
uint32_t timeout_count, key;
|
||||
|
||||
int32_t dx, dy;
|
||||
|
||||
for (p=0; p < PS2_get_num_if(); p++)
|
||||
|
||||
for (p=0; p < PS2_NUM_IF; p++)
|
||||
{
|
||||
pIF = PS2_get_if(p);
|
||||
pIF = (ps2_if_t const *)con_getPort(ps2_fd[p])->pInst;
|
||||
if (SYS_PS2_BIT_RX_ERR_FLAG & *pIF->pCTRL)
|
||||
fprintf(stderr, "PS2[%d]: Status = 0x%08X\n", p, *pIF->pCTRL);
|
||||
|
||||
@@ -235,8 +238,8 @@ int main(void)
|
||||
printf("UART0 Status = 0x%8.8X\n", *pUART0_stat);
|
||||
printf("UART1 Status = 0x%8.8X\n", *pUART1_stat);
|
||||
|
||||
PS2_init(0);
|
||||
PS2_init(1);
|
||||
ps2_fd[0] = open("PS2-0", 0, 0);
|
||||
ps2_fd[1] = open("PS2-1", 0, 0);
|
||||
|
||||
sputs("r: "); print_word((int)pPtr_r); sputs("\n");
|
||||
sputs("w: "); print_word((int)pPtr_w); sputs("\n");
|
||||
@@ -253,8 +256,8 @@ int main(void)
|
||||
printf("Du schriebst: %s\n", string);
|
||||
|
||||
// Flush buffer
|
||||
PS2_flush(0);
|
||||
PS2_flush(1);
|
||||
PS2_flush((ps2_if_t*)(con_getPort(ps2_fd[0])->pInst));
|
||||
PS2_flush((ps2_if_t*)(con_getPort(ps2_fd[1])->pInst));
|
||||
|
||||
printf("Start:\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user