Disable USB interrupts while updting display.

Hope this is correct. It appears to work, at least :-)
This commit is contained in:
Stefan `Sec` Zehl 2011-06-27 10:43:46 +02:00
parent bb4b0f1b9c
commit 26c01e0baa
1 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,7 @@
#include "core/ssp/ssp.h" #include "core/ssp/ssp.h"
#include "gpio/gpio.h" #include "gpio/gpio.h"
#include "basic/basic.h" #include "basic/basic.h"
#include "usb/usbmsc.h"
/**************************************************************************/ /**************************************************************************/
/* Utility routines to manage nokia display */ /* Utility routines to manage nokia display */
@ -11,11 +12,16 @@
uint8_t lcdBuffer[RESX*RESY_B]; uint8_t lcdBuffer[RESX*RESY_B];
int inverted = 0; int inverted = 0;
uint32_t intstatus;
#define TYPE_CMD 0 #define TYPE_CMD 0
#define TYPE_DATA 1 #define TYPE_DATA 1
static void select() { static void select() {
if(usbMSCenabled){
intstatus=USB_DEVINTEN;
USB_DEVINTEN=0;
};
/* the LCD requires 9-Bit frames */ /* the LCD requires 9-Bit frames */
uint32_t configReg = ( SSP_SSP0CR0_DSS_9BIT // Data size = 9-bit uint32_t configReg = ( SSP_SSP0CR0_DSS_9BIT // Data size = 9-bit
| SSP_SSP0CR0_FRF_SPI // Frame format = SPI | SSP_SSP0CR0_FRF_SPI // Frame format = SPI
@ -31,6 +37,9 @@ static void deselect() {
| SSP_SSP0CR0_FRF_SPI // Frame format = SPI | SSP_SSP0CR0_FRF_SPI // Frame format = SPI
| SSP_SSP0CR0_SCR_8); // Serial clock rate = 8 | SSP_SSP0CR0_SCR_8); // Serial clock rate = 8
SSP_SSP0CR0 = configReg; SSP_SSP0CR0 = configReg;
if(usbMSCenabled){
USB_DEVINTEN=intstatus;
};
} }
static void lcdWrite(uint8_t cd, uint8_t data) { static void lcdWrite(uint8_t cd, uint8_t data) {