1.1 --- a/stage2/irq.c Tue Feb 23 23:39:38 2016 +0100
1.2 +++ b/stage2/irq.c Tue Feb 23 23:57:53 2016 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Interrupt handling.
1.6 *
1.7 - * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software: you can redistribute it and/or modify
1.11 * it under the terms of the GNU General Public License as published by
1.12 @@ -28,33 +28,31 @@
1.13 #include "lcd.h"
1.14 #include "jzlcd.h"
1.15 #include "cpu.h"
1.16 +#include "irq.h"
1.17
1.18 extern vidinfo_t panel_info;
1.19 -static unsigned short pixel_type;
1.20 -static unsigned short x, y;
1.21 -extern unsigned long lastdec;
1.22
1.23 -void next_pixel()
1.24 +void next_pixel(unsigned short *x, unsigned short *y)
1.25 {
1.26 - x++;
1.27 - if (x >= panel_info.vl_col) {
1.28 - x = 0;
1.29 - y++;
1.30 - if (y >= panel_info.vl_row)
1.31 - y = 0;
1.32 + (*x)++;
1.33 + if (*x >= panel_info.vl_col) {
1.34 + *x = 0;
1.35 + (*y)++;
1.36 + if (*y >= panel_info.vl_row)
1.37 + *y = 0;
1.38 }
1.39 }
1.40
1.41 /* Tasks. */
1.42
1.43 -void plot_pattern()
1.44 +void plot_pattern(unsigned short pixel_type, unsigned short x, unsigned short y)
1.45 {
1.46 while (1) {
1.47 if (pixel_type)
1.48 test_pixel(x, y);
1.49 else
1.50 clear_pixel(x, y);
1.51 - next_pixel();
1.52 + next_pixel(&x, &y);
1.53 udelay(100);
1.54 }
1.55 }
1.56 @@ -64,7 +62,6 @@
1.57 void irq_init()
1.58 {
1.59 timer_init_irq();
1.60 - x = 0; y = 0; pixel_type = 1;
1.61 handle_error_level();
1.62 init_interrupts();
1.63 enable_interrupts();
1.64 @@ -80,7 +77,7 @@
1.65
1.66 /* Update the pixel type. */
1.67
1.68 - pixel_type = __gpio_get_pin(GPIO_POWER);
1.69 + /* pixel_type = __gpio_get_pin(GPIO_POWER); */
1.70
1.71 /* Clear interrupt status. */
1.72
1.73 @@ -100,7 +97,7 @@
1.74 void start_task()
1.75 {
1.76 enter_user_mode();
1.77 - plot_pattern();
1.78 + plot_pattern(1, 0, 0);
1.79 }
1.80
1.81 void tlb_handle()