[mips]
- libsys multitarget - apps multitarget git-svn-id: http://moon:8086/svn/mips@67 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+10
-8
@@ -5,12 +5,13 @@
|
||||
#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"
|
||||
|
||||
#define PS2_NUM_IF 2
|
||||
static volatile int32_t mouse_x;
|
||||
static volatile int32_t mouse_y;
|
||||
static box_t box_even, box_odd, line_h_even, line_v_even, line_h_odd, line_v_odd, cross_v, cross_h;
|
||||
@@ -18,6 +19,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 handler5(void)
|
||||
@@ -32,15 +34,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);
|
||||
|
||||
@@ -155,12 +157,12 @@ int main(void)
|
||||
GFX_show(&gfx);
|
||||
printf("VGA status = %08X\n", *pVGA_ctrl);
|
||||
|
||||
PS2_init(0);
|
||||
PS2_init(1);
|
||||
ps2_fd[0] = open("PS2-0", 0, 0);
|
||||
ps2_fd[1] = open("PS2-1", 0, 0);
|
||||
|
||||
// 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));
|
||||
|
||||
// interrupt_enable(5);
|
||||
interrupt_enable(6);
|
||||
|
||||
Reference in New Issue
Block a user