- added missing declarations
- reduced compiler warnings git-svn-id: http://moon:8086/svn/mips@180 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
+2
-2
@@ -15,13 +15,13 @@ uint32_t gpio_clean(gpio_if_t *pGPIO)
|
||||
|
||||
uint32_t gpio_write(gpio_if_t *pGPIO, uint32_t mask, uint32_t shift, uint32_t offset, uint32_t value)
|
||||
{
|
||||
*(pGPIO->pBase + offset) = (*(pGPIO->pBase + offset) & ~(mask << shift)) | ((value & mask) << shift);
|
||||
*(pGPIO->pBase + offset) = (((*(pGPIO->pBase + offset) >> shift) & ~mask) | (value & mask)) << shift;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t gpio_read(gpio_if_t *pGPIO, uint32_t mask, uint32_t shift, uint32_t offset, uint32_t *pValue)
|
||||
{
|
||||
*pValue = (*(pGPIO->pBase + offset) & (mask << shift)) >> shift;
|
||||
*pValue = (*(pGPIO->pBase + offset) >> shift) & mask;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,12 +80,14 @@ void _GFX_memset32_hw(uint32_t* pDst, uint32_t value, uint32_t ndwords, uint32_t
|
||||
void _GFX_BLIT_const(uint32_t* pDst, uint32_t xdim_dst, uint32_t xmin, uint32_t ymin, uint32_t xmax, uint32_t ymax, uint32_t value);
|
||||
void _GFX_BLIT_const_hw(uint32_t* pDst, uint32_t xdim_dst, uint32_t xmin, uint32_t ymin, uint32_t xmax, uint32_t ymax, uint32_t value, uint32_t wait_finish);
|
||||
void GFX_init(gfx_t *pObj);
|
||||
void GFX_set_background(gfx_t *pObj, uint32_t *pImage, uint32_t image_nx, uint32_t image_ny, uint32_t image_scale_x, uint32_t image_scale_y);
|
||||
void GFX_frame(gfx_t *pObj, uint32_t sync_mode);
|
||||
void GFX_show(gfx_t *pObj);
|
||||
void GFX_copy_front2back(gfx_t *pObj);
|
||||
void GFX_get_FB_front(gfx_t *pObj, uint32_t **ppFB);
|
||||
void box_create(box_t *pObj, uint32_t w, uint32_t h);
|
||||
void GFX_restore(gfx_t *pObj, box_t *pBox, uint32_t posx, uint32_t posy);
|
||||
void GFX_box_draw_direct(gfx_t *pObj, box_t *pBox, uint32_t posx, uint32_t posy, uint32_t color);
|
||||
void GFX_box_draw(gfx_t *pObj, box_t *pBox, uint32_t posx, uint32_t posy, uint32_t color);
|
||||
void GFX_box_draw_bg(gfx_t *pObj, box_t *pBox, uint32_t posx, uint32_t posy, uint32_t color);
|
||||
void GFX_box_blit_bg(gfx_t *pObj, box_t *pBox, uint32_t pos_x_src, uint32_t pos_y_src, uint32_t pos_x_dst, uint32_t pos_y_dst);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ static volatile int32_t mouse_y;
|
||||
static box_t box;
|
||||
static gfx_t gfx;
|
||||
static volatile int _g_posx, _g_posy;
|
||||
static volatile g_btn_l, g_btn_r;
|
||||
static volatile uint32_t g_btn_l, g_btn_r;
|
||||
static volatile uint32_t g_color;
|
||||
static char *ps2_name[PS2_NUM_IF] = {"PS2-0", "PS2-1"};
|
||||
|
||||
|
||||
+13
-6
@@ -1,12 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/time.h>
|
||||
#include <libsys.h>
|
||||
#include <mips_gfx.h>
|
||||
#include <console.h>
|
||||
|
||||
#include <gpio.h>
|
||||
#include <cop0.h>
|
||||
#include <irq.h>
|
||||
#include <mips_gfx.h>
|
||||
#include <mips_ps2.h>
|
||||
@@ -23,6 +28,7 @@
|
||||
#define PIC_NY 600
|
||||
|
||||
extern int paranoia(int argc, char **argv);
|
||||
extern int calibrate_delay(void);
|
||||
|
||||
gpio_if_t gpio_if;
|
||||
|
||||
@@ -102,7 +108,7 @@ int IsEndianBig(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void handler3(struct xcptcontext *xcp)
|
||||
void handler3(EXCEPTION_CONTEXT *xcp)
|
||||
{
|
||||
volatile uint32_t *pUART_stat = (uint32_t*)SYS_UART_STAT;
|
||||
volatile uint32_t *pUART_data = (uint32_t*)SYS_UART_DATA;
|
||||
@@ -119,7 +125,7 @@ box_t box;
|
||||
gfx_t gfx;
|
||||
int posx, posy;
|
||||
|
||||
void handler7(struct xcptcontext *xcp)
|
||||
void handler7(EXCEPTION_CONTEXT *xcp)
|
||||
{
|
||||
uint32_t volatile *pTim_stat = (uint32_t*)SYS_ITIM_STAT;
|
||||
uint32_t volatile *pTim_ctrl = (uint32_t*)SYS_ITIM_CTRL;
|
||||
@@ -1165,14 +1171,15 @@ int main (void)
|
||||
posx = posy = 0;
|
||||
GFX_show(&gfx);
|
||||
|
||||
interrupt_enable(7);
|
||||
// interrupt_enable(7);
|
||||
// *pTim_ctrl |= 3;
|
||||
interrupt_enable(3);
|
||||
*pTim_ctrl |= 3;
|
||||
*pUART_stat |= (1 << 6);
|
||||
// *pUART_stat |= (1 << 6);
|
||||
|
||||
cnt = 0;
|
||||
while (1)
|
||||
{
|
||||
#if 0
|
||||
for (i=0; i < 100000; i++)
|
||||
{
|
||||
interrupt_disable(7);
|
||||
@@ -1181,7 +1188,7 @@ int main (void)
|
||||
{
|
||||
interrupt_enable(7);
|
||||
}
|
||||
|
||||
#endif
|
||||
gpio_write(&gpio_if, GPIO_0_MASK_LED, GPIO_0_ALIGN_LED, GPIO_DATA_OFFSET, cnt);
|
||||
|
||||
printf("-------------------------------------------\n");
|
||||
|
||||
Reference in New Issue
Block a user