Commit 7f699021 authored by Léo Grange's avatar Léo Grange
Browse files

fixed #7 (Merge branch 'tty_input_mode')

parents f5fe475c f50793a8
Loading
Loading
Loading
Loading
+32 −15
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ static struct cyclic_fifo _usb_fifo_ep1o = {
// setup callback
usb_setup_callback_t _usb_setup_callback = NULL;

// ep1 receive callback
usb_receive_callback_t _usb_ep1_receive_callback = NULL;


// debug stuff
extern int _magic_lock;
@@ -172,6 +175,12 @@ int usb_receive(int endpoint, char *data, size_t size, int flags) {
}


void usb_set_receive_callback(int endpoint, usb_receive_callback_t callback) {
	if(endpoint == USB_EP_EP1)
		_usb_ep1_receive_callback = callback;
}


static void usb_sh3_ep1_read(int nbread) {
	(void)nbread; // not used for now

@@ -354,6 +363,13 @@ void usb_sh3_interrupt_handler() {
		int i;
		int nbreceived = USB.EPSZ1;

		// call the async receive callback?
		if(_usb_ep1_receive_callback != NULL) {
			for(i=0; i<nbreceived; i++)
				_usb_ep1_receive_callback(USB.EPDR1);
			USB.TRG.BIT.EP1RDFN = 1;
		}
		else {
			// try to copy received data to ep1 buffer
			if(_usb_fifo_ep1o.size + nbreceived <= _usb_fifo_ep1o.max_size) {

@@ -373,6 +389,7 @@ void usb_sh3_interrupt_handler() {
				// the buffer was read, and maybe EP1FULL can be re-enabled
				USB.IER0.BIT.EP1FULL = 0;
			}
		}

		USB.IFR0.BIT.EP1FULL = 0;
		jobdone = 1;
+4 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ void kdebug_oops(const char *errstr) {

	kdebug_print_vmspace(proc);

	printk_force_flush();

	// print each kernel context information
	kdebug_print_trace();

@@ -113,5 +115,7 @@ void kdebug_oops(const char *errstr) {
		cont = cont->previous;
	}

	printk_force_flush();

	while(1);
}
+8 −0
Original line number Diff line number Diff line
@@ -9,6 +9,14 @@ size_t disp_mono_height() {
	return 64;
}


// TODO find a way to inline these functions AND to keep generic aspect
uint32 disp_mono_get_pixel(int x, int y, void *vram) {
	// no check on (x;y) to keep performances...
	return !!( ((char*)vram)[y*16 + x/8] & (1 << x%8));
}


void disp_mono_draw_bitmap(int x, int y, unsigned char *bitmap, short w, short h, void *vvram)
{
	unsigned char *vram = vvram;

device/display/T6K11/T6K11.h

deleted100644 → 0
+0 −25
Original line number Diff line number Diff line
#ifndef DISPLAY_T6K11_H
#define DISPLAY_T6K11_H


// real type of vram_t
typedef unsigned char *vram_t;
typedef int color_t;
struct _mono_bitmap {
	unsigned char *bitmap;
	int w;
	int h;
};
typedef struct _mono_bitmap bitmap_t;

// Colors Typedef :
#define PIXEL_WHITE	0
#define PIXEL_BLACK	1
#define PIXEL_XOR	2


// Return 0xFFFFFFFF if it's a dark color, 0x00000000 else
unsigned int mask_color();

#endif  //DISPLAY_T6K11_H
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,11 @@ void disp_mono_copy_to_dd(void *vram);
 */
void disp_mono_set_pixel(int x, int y, uint32 color, void *vram);

/**
 * Read a pixel from the VRAM, and return its color.
 */
uint32 disp_mono_get_pixel(int x, int y, void *vram);

/**
 * Returns width/height of the display, in pixels.
 */
Loading