From 56d972ad572fd270a117858a982b106a3175d8e0 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 3 Jan 2010 10:19:43 +0000 Subject: Fix tabs git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24153 a1c6a512-1295-4272-9138-f99709370657 --- .../arm/tms320dm320/creative-zvm/usb-creativezvm.c | 4 +- firmware/target/arm/tms320dm320/debug-dm320.c | 26 +- firmware/target/arm/tms320dm320/dsp/arm.c | 40 +-- firmware/target/arm/tms320dm320/dsp/dma.c | 330 ++++++++++----------- firmware/target/arm/tms320dm320/dsp/dsp-image.h | 14 +- .../target/arm/tms320dm320/dsp_image_helloworld.h | 2 +- .../target/arm/tms320dm320/mrobe-500/lcd-mr500.c | 192 ++++++------ .../target/arm/tms320dm320/mrobe-500/power-mr500.c | 10 +- 8 files changed, 309 insertions(+), 309 deletions(-) (limited to 'firmware/target/arm/tms320dm320') diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c index d3f7789ab0..a70f260b85 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/usb-creativezvm.c @@ -66,7 +66,7 @@ void IRAM_ATTR GIO7(void) #ifdef DEBUG //printf("GIO7 interrupt... [%d]", current_tick); #endif - usb_drv_int(); + usb_drv_int(); - IO_INTC_IRQ1 = INTR_IRQ1_EXT7; + IO_INTC_IRQ1 = INTR_IRQ1_EXT7; } diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c index 9563a13302..8be21065d6 100644 --- a/firmware/target/arm/tms320dm320/debug-dm320.c +++ b/firmware/target/arm/tms320dm320/debug-dm320.c @@ -41,7 +41,7 @@ bool __dbg_ports(void) #if defined(MROBE_500) int line = 0; int i; - int button; + int button; bool done=false; lcd_setfont(FONT_SYSFIXED); @@ -124,7 +124,7 @@ bool __dbg_ports(void) bool __dbg_hw_info(void) { int line = 0, oldline; - int button; + int button; #if defined(MROBE_500) int *address=0x0; #endif @@ -175,18 +175,18 @@ bool __dbg_hw_info(void) IO_INTC_EINT2, IO_INTC_IRQ0); lcd_putsf(0, line++, " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2); - + lcd_puts(0, line++, "Board revision:"); - switch (IO_BUSC_REVR) { - case 0x0010: - lcd_puts(0, line++, " DM320 Rev. A"); - break; - case 0x0011: - lcd_puts(0, line++, " DM320 Rev. B/C"); - break; - default: - lcd_puts(0, line++, " Unknown DM320 Chip ID"); - } + switch (IO_BUSC_REVR) { + case 0x0010: + lcd_puts(0, line++, " DM320 Rev. A"); + break; + case 0x0011: + lcd_puts(0, line++, " DM320 Rev. B/C"); + break; + default: + lcd_puts(0, line++, " Unknown DM320 Chip ID"); + } #if defined(MROBE_500) line++; diff --git a/firmware/target/arm/tms320dm320/dsp/arm.c b/firmware/target/arm/tms320dm320/dsp/arm.c index e0df31c7a1..9d886ffede 100644 --- a/firmware/target/arm/tms320dm320/dsp/arm.c +++ b/firmware/target/arm/tms320dm320/dsp/arm.c @@ -42,24 +42,24 @@ interrupt void handle_int0(void) { waiting = 0; if(dma0_stopped==0) - { - if(!(DMPREC&0x01)) - { - /* Give the HPIB access to refill first */ - rebuffer(); - - /* Start the MCBSP DMA */ - DMPREC |= 1; - audiohw_start(); - } - else - { - rebuffer(); - } - } - else - { - rebuffer(); + { + if(!(DMPREC&0x01)) + { + /* Give the HPIB access to refill first */ + rebuffer(); + + /* Start the MCBSP DMA */ + DMPREC |= 1; + audiohw_start(); + } + else + { + rebuffer(); + } + } + else + { + rebuffer(); } } @@ -88,8 +88,8 @@ void debugf(const char *fmt, ...) { vsnprintf((char *)status.payload.debugf.buffer, sizeof(status), fmt, args); va_end(args); - startack(); - waitack(); + startack(); + waitack(); acked = 2; } diff --git a/firmware/target/arm/tms320dm320/dsp/dma.c b/firmware/target/arm/tms320dm320/dsp/dma.c index 590b35de80..3048d294b1 100644 --- a/firmware/target/arm/tms320dm320/dsp/dma.c +++ b/firmware/target/arm/tms320dm320/dsp/dma.c @@ -8,13 +8,13 @@ * $Id$ * * Copyright (C) 2008 by Catalin Patulea - * Copyright (C) 2008 by Maurus Cuelenaere + * Copyright (C) 2008 by Maurus Cuelenaere * Copyright (C) 2009 by Karl Kurbjun * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. @@ -23,139 +23,139 @@ #include "registers.h" #include "arm.h" -#include "ipc.h" - -/* Size of data buffer in words (16 bit) */ -#define DSP_BUFFER_SIZE (0x1000) +#include "ipc.h" -/* Put the "data" buffer in it's own .dma section so that it can +/* Size of data buffer in words (16 bit) */ +#define DSP_BUFFER_SIZE (0x1000) + +/* Put the "data" buffer in it's own .dma section so that it can * be handled in the linker.cmd. */ -#pragma DATA_SECTION (data, ".dma") - +#pragma DATA_SECTION (data, ".dma") + /* This is the "data" buffer on the DSP side used for SARAM to McBSP (IIS) */ static signed short data[DSP_BUFFER_SIZE]; /* These two describe the location of the buffer on the ARM (set in DSPHINT) */ volatile unsigned short sdem_addrh; -volatile unsigned short sdem_addrl; - -/* This is the size of the ARM buffer (set in DSPHINT) */ -volatile unsigned short sdem_dsp_size; - -/* These two variables keep track of the buffer level in the DSP, dsp_level, - * (SARAM to McBSP) and the level on the ARM buffer (sdem_level). - * sdem_level is used in the main firmware to keep track of the current - * playback status. dsp_level is only used in this function. */ -static unsigned short dsp_level; -volatile unsigned short sdem_level; - -/* This is used to keep track of the last SDRAM to SARAM transfer */ -static unsigned short last_size; - -/* This tells us which half of the DSP buffer (data) is free */ -static unsigned short dma0_unlocked; - -/* This is used by the ARM to flag playback status and start/stop the DMA - * transfers. */ +volatile unsigned short sdem_addrl; + +/* This is the size of the ARM buffer (set in DSPHINT) */ +volatile unsigned short sdem_dsp_size; + +/* These two variables keep track of the buffer level in the DSP, dsp_level, + * (SARAM to McBSP) and the level on the ARM buffer (sdem_level). + * sdem_level is used in the main firmware to keep track of the current + * playback status. dsp_level is only used in this function. */ +static unsigned short dsp_level; +volatile unsigned short sdem_level; + +/* This is used to keep track of the last SDRAM to SARAM transfer */ +static unsigned short last_size; + +/* This tells us which half of the DSP buffer (data) is free */ +static unsigned short dma0_unlocked; + +/* This is used by the ARM to flag playback status and start/stop the DMA + * transfers. */ volatile unsigned short dma0_stopped; - -/* This is used to effectively flag whether the ARM has new data ready or not */ -short waiting; - - -/* rebuffer sets up the next SDRAM to SARAM transfer and tells the ARM when DMA - * needs a new buffer. - * - * Note: The upper limit on larger buffers is the size of a short. If larger - * buffer sizes are needed the code on the ARM side needs to be changed to - * update a full long. - */ -void rebuffer(void) -{ - unsigned long sdem_addr; - - if(dma0_stopped==1 || dma0_stopped==2) /* Stop / Pause */ - { - /* Stop MCBSP DMA0 */ - DMPREC &= 0xFFFE; - /* Shut the transmitter down */ - audiohw_stop(); - - /* Stop the HPIB transfer if it is running */ - DMA_TRG = 0; - - /* Reset the following variables for DMA restart */ - sdem_level = 0; - dsp_level = 0; - last_size = 0; - - return; - } - - /* If the sdem_level is equal to the buffer size the ARM code gave - * (sdem_dsp_size) then reset the size and ask the arm for another buffer - */ - if(sdem_level == sdem_dsp_size) - { - sdem_level=0; - - /* Get a new buffer (location and size) from ARM */ - status.msg = MSG_REFILL; - waiting=1; - + +/* This is used to effectively flag whether the ARM has new data ready or not */ +short waiting; + + +/* rebuffer sets up the next SDRAM to SARAM transfer and tells the ARM when DMA + * needs a new buffer. + * + * Note: The upper limit on larger buffers is the size of a short. If larger + * buffer sizes are needed the code on the ARM side needs to be changed to + * update a full long. + */ +void rebuffer(void) +{ + unsigned long sdem_addr; + + if(dma0_stopped==1 || dma0_stopped==2) /* Stop / Pause */ + { + /* Stop MCBSP DMA0 */ + DMPREC &= 0xFFFE; + /* Shut the transmitter down */ + audiohw_stop(); + + /* Stop the HPIB transfer if it is running */ + DMA_TRG = 0; + + /* Reset the following variables for DMA restart */ + sdem_level = 0; + dsp_level = 0; + last_size = 0; + + return; + } + + /* If the sdem_level is equal to the buffer size the ARM code gave + * (sdem_dsp_size) then reset the size and ask the arm for another buffer + */ + if(sdem_level == sdem_dsp_size) + { + sdem_level=0; + + /* Get a new buffer (location and size) from ARM */ + status.msg = MSG_REFILL; + waiting=1; + /* trigger DSPHINT on the ARM */ - int_arm(); - } - - if(!waiting) - { - /* Size is in bytes (but forced 32 bit transfers). Comparison is - * against DSP_BUFFER_SIZE because it is in words and this needs to - * compare against half the total size in bytes. */ - if( dsp_level + sdem_dsp_size - sdem_level > DSP_BUFFER_SIZE) - { - last_size = DSP_BUFFER_SIZE - dsp_level; - } - else - { + int_arm(); + } + + if(!waiting) + { + /* Size is in bytes (but forced 32 bit transfers). Comparison is + * against DSP_BUFFER_SIZE because it is in words and this needs to + * compare against half the total size in bytes. */ + if( dsp_level + sdem_dsp_size - sdem_level > DSP_BUFFER_SIZE) + { + last_size = DSP_BUFFER_SIZE - dsp_level; + } + else + { last_size = sdem_dsp_size - sdem_level; - } - - /* DSP addresses are 16 bit (word). dsp_level is in bytes so it needs to + } + + /* DSP addresses are 16 bit (word). dsp_level is in bytes so it needs to * be converted to words. */ DSP_ADDRL = (unsigned short)data + dma0_unlocked + (dsp_level >> 1); - DSP_ADDRH = 0; - - /* SDRAM addresses are 8 bit (byte) - * Warning: These addresses are forced to 32 bit alignment! - */ - sdem_addr = ((unsigned long)sdem_addrh << 16 | sdem_addrl) + sdem_level; - SDEM_ADDRL = sdem_addr & 0xffff; - SDEM_ADDRH = sdem_addr >> 16; - - /* Set the size of the SDRAM to SARAM transfer (demac transfer) */ - DMA_SIZE = last_size; + DSP_ADDRH = 0; + + /* SDRAM addresses are 8 bit (byte) + * Warning: These addresses are forced to 32 bit alignment! + */ + sdem_addr = ((unsigned long)sdem_addrh << 16 | sdem_addrl) + sdem_level; + SDEM_ADDRL = sdem_addr & 0xffff; + SDEM_ADDRH = sdem_addr >> 16; + + /* Set the size of the SDRAM to SARAM transfer (demac transfer) */ + DMA_SIZE = last_size; DMA_CTRL = 0; - + /* These are just debug signals that are not used/needed right now */ status.payload.refill._DMA_TRG = DMA_TRG; status.payload.refill._SDEM_ADDRH = SDEM_ADDRH; status.payload.refill._SDEM_ADDRL = SDEM_ADDRL; status.payload.refill._DSP_ADDRH = DSP_ADDRH; status.payload.refill._DSP_ADDRL = DSP_ADDRL; - + /* Start the demac transfer */ - DMA_TRG = 1; - } -} - -/* This interupt handler is for the SARAM (on DSP) to McBSP IIS DMA transfer. - * It interupts at 1/2 empty and empty so that we can start filling a new buffer - * from SDRAM when a half is free. dsp_level should always be full when this + DMA_TRG = 1; + } +} + +/* This interupt handler is for the SARAM (on DSP) to McBSP IIS DMA transfer. + * It interupts at 1/2 empty and empty so that we can start filling a new buffer + * from SDRAM when a half is free. dsp_level should always be full when this * interupt occurs except for the initial start. */ -interrupt void handle_dma0(void) -{ +interrupt void handle_dma0(void) +{ /* Byte offset to half-buffer locked by DMA0. 0 for top, DSP_BUFFER_SIZE/2 for bottom */ unsigned short dma0_locked; @@ -163,70 +163,70 @@ interrupt void handle_dma0(void) IFR = 1 << 6; /* DMSRC0 is the beginning of the DMA0-locked SARAM half-buffer. */ - DMSA = 0x00 /* DMSRC0 (banked register, see page 133 of SPRU302B */; - - /* Note that these address offsets (dma0_locked and dma0_unlocked are in + DMSA = 0x00 /* DMSRC0 (banked register, see page 133 of SPRU302B */; + + /* Note that these address offsets (dma0_locked and dma0_unlocked are in * words. */ dma0_locked = DMSDN & (DSP_BUFFER_SIZE>>1); - dma0_unlocked = dma0_locked ^ (DSP_BUFFER_SIZE>>1); - - dsp_level = 0; - - /* Start the SDRAM to SARAM copy */ + dma0_unlocked = dma0_locked ^ (DSP_BUFFER_SIZE>>1); + + dsp_level = 0; + + /* Start the SDRAM to SARAM copy */ rebuffer(); } - -/* This interupt handler runs every time a DMA transfer is complete from SDRAM - * to the SARAM buffer. It is used to update the SARAM buffer level - * (dsp_level), the SDRAM buffer level (sdem_level) and to rebuffer if the dsp + +/* This interupt handler runs every time a DMA transfer is complete from SDRAM + * to the SARAM buffer. It is used to update the SARAM buffer level + * (dsp_level), the SDRAM buffer level (sdem_level) and to rebuffer if the dsp * buffer is not full. */ interrupt void handle_dmac(void) { - IFR = 1 << 11; /* Clear interrupt */ - - /* dsp_level and sdem_level are in bytes */ - dsp_level += last_size; - sdem_level += last_size; - - /* compare to DSP_BUFFER_SIZE without a divide because it is in words and - * we want half the total size in bytes. */ - if(dsp_level < DSP_BUFFER_SIZE) - { - rebuffer(); + IFR = 1 << 11; /* Clear interrupt */ + + /* dsp_level and sdem_level are in bytes */ + dsp_level += last_size; + sdem_level += last_size; + + /* compare to DSP_BUFFER_SIZE without a divide because it is in words and + * we want half the total size in bytes. */ + if(dsp_level < DSP_BUFFER_SIZE) + { + rebuffer(); } } -void dma_init(void) { - /* Initialize some of the global variables to known values avoiding the - * .cinit section. */ - dsp_level = 0; - sdem_level = 0; - - last_size = 0; - dma0_unlocked = 0; - dma0_stopped = 1; - - waiting = 0; - - /* Configure SARAM to McBSP DMA */ - +void dma_init(void) { + /* Initialize some of the global variables to known values avoiding the + * .cinit section. */ + dsp_level = 0; + sdem_level = 0; + + last_size = 0; + dma0_unlocked = 0; + dma0_stopped = 1; + + waiting = 0; + + /* Configure SARAM to McBSP DMA */ + /* Event XEVT0, 32-bit transfers, 0 frame count */ - DMSFC0 = 2 << 12 | 1 << 11; - - /* Interrupts generated, Half and full buffer. - * ABU mode, From data space with postincrement, to data space with no - * change + DMSFC0 = 2 << 12 | 1 << 11; + + /* Interrupts generated, Half and full buffer. + * ABU mode, From data space with postincrement, to data space with no + * change */ DMMCR0 = 1 << 14 | 1 << 13 | - 1 << 12 | 1 << 8 | 1 << 6 | 1; - + 1 << 12 | 1 << 8 | 1 << 6 | 1; + /* Set the source (incrementing) location */ - DMSRC0 = (unsigned short)&data; - + DMSRC0 = (unsigned short)&data; + /* Set the destination (static) location to the McBSP IIS interface */ - DMDST0 = (unsigned short)&DXR20; - + DMDST0 = (unsigned short)&DXR20; + /* Set the size of the buffer */ - DMCTR0 = sizeof(data); + DMCTR0 = sizeof(data); /* Setup DMA0 interrupts and start the transfer */ DMPREC = 2 << 6; diff --git a/firmware/target/arm/tms320dm320/dsp/dsp-image.h b/firmware/target/arm/tms320dm320/dsp/dsp-image.h index f7ec449a33..9f7ff65828 100644 --- a/firmware/target/arm/tms320dm320/dsp/dsp-image.h +++ b/firmware/target/arm/tms320dm320/dsp/dsp-image.h @@ -20,19 +20,19 @@ * */ static const unsigned short _section_text[] = { - 0xf495, 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17, 0x4a17, 0x4a19, 0x4a0e, 0x4a06, 0x4a07, 0x4a1a, 0x4a1d, 0x4a1b, 0x4a1c, 0x68f8, 0x0007, 0x7d3f, 0x69f8, 0x0007, 0x4000, 0x68f8, 0x001d, 0xfffc, 0x4818, 0x68f8, 0x0018, 0xfffe, 0x7711, 0x0001, 0x4a08, 0x7681, 0x0001, 0x10f8, 0x031d, 0x76f8, 0x031e, 0x0000, 0xfa44, 0x00c2, 0xf495, 0xeeff, 0x7712, 0x0054, 0x960f, 0xf830, 0x00c2, 0xf074, 0x00fc, 0x7711, 0x0054, 0x6981, 0x0001, 0xf074, 0x02af, 0xf073, 0x00c4, 0xf074, 0x00fc, 0xee01, 0x8a18, 0xf495, 0x8a1c, 0x8a1b, 0x8a1d, 0x8a1a, 0x8a07, 0x8a06, 0x8a0e, 0x8a19, 0x8a17, 0x8a17, 0x8a16, 0x8a15, 0x8a14, 0x8a13, 0x8a12, 0x8a11, 0x8a10, 0x8a0d, 0x8a0c, 0x8a0b, 0x8a0a, 0x8a09, 0x8a08, 0xf4eb, 0x4a11, 0x7711, 0x0026, 0x7712, 0x0001, 0x7713, 0x0001, 0x7681, 0x0010, 0x7711, 0x0000, 0x7681, 0xffff, 0xe501, 0xf495, 0xf6bb, 0xf074, 0x0284, 0xf074, 0x0243, 0xf4e1, 0xf495, 0xf073, 0x00f3, 0xe808, 0x75f8, 0x0008, 0x0280, 0xfc00, 0x4a11, 0x60f8, 0x031d, 0x0001, 0xfa30, 0x0109, 0xf495, 0xeefe, 0x60f8, 0x031d, 0x0002, 0xf820, 0x011e, 0x7711, 0x0054, 0x6881, 0xfffe, 0xf074, 0x02ba, 0xe800, 0x75f8, 0x0008, 0x8006, 0x76f8, 0x031b, 0x0000, 0x76f8, 0x0319, 0x0000, 0x76f8, 0x031a, 0x0000, 0xf073, 0x018b, 0x10f8, 0x031a, 0x08f8, 0x0318, 0xf844, 0x012f, 0x76f8, 0x031a, 0x0000, 0x76f8, 0x031e, 0x0001, 0x76f8, 0x02c5, 0x0003, 0xf074, 0x00f7, 0x10f8, 0x031e, 0xf844, 0x018b, 0x10f8, 0x0318, 0x00f8, 0x0319, 0x08f8, 0x031a, 0x8811, 0xf495, 0x7710, 0x1000, 0xf6a9, 0xf820, 0x0146, 0xf020, 0x1000, 0xf273, 0x014a, 0x08f8, 0x0319, 0x10f8, 0x0318, 0x08f8, 0x031a, 0x80f8, 0x031b, 0x10f8, 0x031c, 0xf6b8, 0xf000, 0x8000, 0x6ff8, 0x0319, 0x0c1f, 0x75f8, 0x0008, 0x8002, 0xe800, 0x75f8, 0x0008, 0x8003, 0x10f8, 0x0316, 0xf1ef, 0xf3e1, 0x10f8, 0x0317, 0xf2a0, 0x00f8, 0x031a, 0x4e00, 0xf020, 0xffff, 0x5700, 0xf280, 0x75f8, 0x0008, 0x8000, 0x5600, 0xf0f0, 0x75f8, 0x0008, 0x8001, 0xe800, 0x75f8, 0x031b, 0x8004, 0x75f8, 0x0008, 0x8005, 0x74f8, 0x02c7, 0x8006, 0x74f8, 0x02c8, 0x8001, 0x74f8, 0x02c9, 0x8000, 0x74f8, 0x02ca, 0x8003, 0xe801, 0x74f8, 0x02cb, 0x8002, 0x75f8, 0x0008, 0x8006, 0xee02, 0x8a11, 0xfc00, 0xf495, 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17, 0x4a17, 0x4a19, 0x4a0e, 0x4a06, 0x4a07, 0x4a1a, 0x4a1d, 0x4a1b, 0x4a1c, 0x68f8, 0x0007, 0x7d3f, 0x69f8, 0x0007, 0x4000, 0x68f8, 0x001d, 0xfffc, 0x4818, 0x68f8, 0x0018, 0xfffe, 0x7711, 0x0001, 0x4a08, 0x7681, 0x0040, 0x7711, 0x0055, 0x7681, 0x0000, 0xf020, 0x0800, 0x7711, 0x0057, 0xeeff, 0x1881, 0x8000, 0xf020, 0x0800, 0x1c00, 0x76f8, 0x0319, 0x0000, 0x80f8, 0x031c, 0xf074, 0x00fc, 0xee01, 0x8a18, 0xf495, 0x8a1c, 0x8a1b, 0x8a1d, 0x8a1a, 0x8a07, 0x8a06, 0x8a0e, 0x8a19, 0x8a17, 0x8a17, 0x8a16, 0x8a15, 0x8a14, 0x8a13, 0x8a12, 0x8a11, 0x8a10, 0x8a0d, 0x8a0c, 0x8a0b, 0x8a0a, 0x8a09, 0x8a08, 0xf4eb, 0xf495, 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17, 0x4a17, 0x4a19, 0x4a0e, 0x4a06, 0x4a07, 0x4a1a, 0x4a1d, 0x4a1b, 0x4a1c, 0x68f8, 0x0007, 0x7d3f, 0x69f8, 0x0007, 0x4000, 0x68f8, 0x001d, 0xfffc, 0x4818, 0x68f8, 0x0018, 0xfffe, 0x7711, 0x0001, 0x4a08, 0x7681, 0x0800, 0x10f8, 0x031b, 0x00f8, 0x0319, 0x80f8, 0x0319, 0x7710, 0x1000, 0x7211, 0x0319, 0x10f8, 0x031b, 0xf5a9, 0xeeff, 0x00f8, 0x031a, 0xfa20, 0x0228, 0x80f8, 0x031a, 0xf074, 0x00fc, 0xee01, 0x8a18, 0xf495, 0x8a1c, 0x8a1b, 0x8a1d, 0x8a1a, 0x8a07, 0x8a06, 0x8a0e, 0x8a19, 0x8a17, 0x8a17, 0x8a16, 0x8a15, 0x8a14, 0x8a13, 0x8a12, 0x8a11, 0x8a10, 0x8a0d, 0x8a0c, 0x8a0b, 0x8a0a, 0x8a09, 0x8a08, 0xf4eb, 0x4a11, 0x7711, 0x0055, 0x76f8, 0x031a, 0x0000, 0x76f8, 0x0319, 0x0000, 0x76f8, 0x031b, 0x0000, 0x76f8, 0x031c, 0x0000, 0x76f8, 0x031e, 0x0000, 0x76f8, 0x031d, 0x0001, 0x7681, 0x0003, 0x7711, 0x0057, 0x7681, 0x2800, 0x7711, 0x0055, 0x7681, 0x0004, 0x7711, 0x0057, 0x7681, 0x7141, 0x7711, 0x0055, 0x7681, 0x0000, 0x7711, 0x0057, 0x7681, 0x8000, 0x7711, 0x0055, 0x7681, 0x0001, 0x7711, 0x0057, 0x7681, 0x0022, 0x7711, 0x0055, 0x7681, 0x0002, 0x7711, 0x0057, 0x7681, 0x1000, 0x7711, 0x0054, 0x7681, 0x0080, 0x8a11, 0xfc00, 0x4a11, 0x7711, 0x0038, 0x7681, 0x0000, 0x7711, 0x0039, 0x7681, 0x0000, 0x7711, 0x0038, 0x7681, 0x0001, 0x7711, 0x0039, 0x7681, 0x0030, 0x7711, 0x0038, 0x7681, 0x000e, 0x7711, 0x0039, 0x7681, 0x0002, 0x7711, 0x0038, 0x7681, 0x0004, 0x7711, 0x0039, 0x7681, 0x00a0, 0x7711, 0x0038, 0x7681, 0x0005, 0x7711, 0x0039, 0x7681, 0x0000, 0x8a11, 0xfc00, 0x4a11, 0x7711, 0x0038, 0x7681, 0x0001, 0x7711, 0x0039, 0x6981, 0x0001, 0x8a11, 0xfc00, 0x4a11, 0x7711, 0x0038, 0x7681, 0x0001, 0x7711, 0x0039, 0x6881, 0xfffe, 0x8a11, 0xfc00, + 0xf495, 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17, 0x4a17, 0x4a19, 0x4a0e, 0x4a06, 0x4a07, 0x4a1a, 0x4a1d, 0x4a1b, 0x4a1c, 0x68f8, 0x0007, 0x7d3f, 0x69f8, 0x0007, 0x4000, 0x68f8, 0x001d, 0xfffc, 0x4818, 0x68f8, 0x0018, 0xfffe, 0x7711, 0x0001, 0x4a08, 0x7681, 0x0001, 0x10f8, 0x031d, 0x76f8, 0x031e, 0x0000, 0xfa44, 0x00c2, 0xf495, 0xeeff, 0x7712, 0x0054, 0x960f, 0xf830, 0x00c2, 0xf074, 0x00fc, 0x7711, 0x0054, 0x6981, 0x0001, 0xf074, 0x02af, 0xf073, 0x00c4, 0xf074, 0x00fc, 0xee01, 0x8a18, 0xf495, 0x8a1c, 0x8a1b, 0x8a1d, 0x8a1a, 0x8a07, 0x8a06, 0x8a0e, 0x8a19, 0x8a17, 0x8a17, 0x8a16, 0x8a15, 0x8a14, 0x8a13, 0x8a12, 0x8a11, 0x8a10, 0x8a0d, 0x8a0c, 0x8a0b, 0x8a0a, 0x8a09, 0x8a08, 0xf4eb, 0x4a11, 0x7711, 0x0026, 0x7712, 0x0001, 0x7713, 0x0001, 0x7681, 0x0010, 0x7711, 0x0000, 0x7681, 0xffff, 0xe501, 0xf495, 0xf6bb, 0xf074, 0x0284, 0xf074, 0x0243, 0xf4e1, 0xf495, 0xf073, 0x00f3, 0xe808, 0x75f8, 0x0008, 0x0280, 0xfc00, 0x4a11, 0x60f8, 0x031d, 0x0001, 0xfa30, 0x0109, 0xf495, 0xeefe, 0x60f8, 0x031d, 0x0002, 0xf820, 0x011e, 0x7711, 0x0054, 0x6881, 0xfffe, 0xf074, 0x02ba, 0xe800, 0x75f8, 0x0008, 0x8006, 0x76f8, 0x031b, 0x0000, 0x76f8, 0x0319, 0x0000, 0x76f8, 0x031a, 0x0000, 0xf073, 0x018b, 0x10f8, 0x031a, 0x08f8, 0x0318, 0xf844, 0x012f, 0x76f8, 0x031a, 0x0000, 0x76f8, 0x031e, 0x0001, 0x76f8, 0x02c5, 0x0003, 0xf074, 0x00f7, 0x10f8, 0x031e, 0xf844, 0x018b, 0x10f8, 0x0318, 0x00f8, 0x0319, 0x08f8, 0x031a, 0x8811, 0xf495, 0x7710, 0x1000, 0xf6a9, 0xf820, 0x0146, 0xf020, 0x1000, 0xf273, 0x014a, 0x08f8, 0x0319, 0x10f8, 0x0318, 0x08f8, 0x031a, 0x80f8, 0x031b, 0x10f8, 0x031c, 0xf6b8, 0xf000, 0x8000, 0x6ff8, 0x0319, 0x0c1f, 0x75f8, 0x0008, 0x8002, 0xe800, 0x75f8, 0x0008, 0x8003, 0x10f8, 0x0316, 0xf1ef, 0xf3e1, 0x10f8, 0x0317, 0xf2a0, 0x00f8, 0x031a, 0x4e00, 0xf020, 0xffff, 0x5700, 0xf280, 0x75f8, 0x0008, 0x8000, 0x5600, 0xf0f0, 0x75f8, 0x0008, 0x8001, 0xe800, 0x75f8, 0x031b, 0x8004, 0x75f8, 0x0008, 0x8005, 0x74f8, 0x02c7, 0x8006, 0x74f8, 0x02c8, 0x8001, 0x74f8, 0x02c9, 0x8000, 0x74f8, 0x02ca, 0x8003, 0xe801, 0x74f8, 0x02cb, 0x8002, 0x75f8, 0x0008, 0x8006, 0xee02, 0x8a11, 0xfc00, 0xf495, 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17, 0x4a17, 0x4a19, 0x4a0e, 0x4a06, 0x4a07, 0x4a1a, 0x4a1d, 0x4a1b, 0x4a1c, 0x68f8, 0x0007, 0x7d3f, 0x69f8, 0x0007, 0x4000, 0x68f8, 0x001d, 0xfffc, 0x4818, 0x68f8, 0x0018, 0xfffe, 0x7711, 0x0001, 0x4a08, 0x7681, 0x0040, 0x7711, 0x0055, 0x7681, 0x0000, 0xf020, 0x0800, 0x7711, 0x0057, 0xeeff, 0x1881, 0x8000, 0xf020, 0x0800, 0x1c00, 0x76f8, 0x0319, 0x0000, 0x80f8, 0x031c, 0xf074, 0x00fc, 0xee01, 0x8a18, 0xf495, 0x8a1c, 0x8a1b, 0x8a1d, 0x8a1a, 0x8a07, 0x8a06, 0x8a0e, 0x8a19, 0x8a17, 0x8a17, 0x8a16, 0x8a15, 0x8a14, 0x8a13, 0x8a12, 0x8a11, 0x8a10, 0x8a0d, 0x8a0c, 0x8a0b, 0x8a0a, 0x8a09, 0x8a08, 0xf4eb, 0xf495, 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17, 0x4a17, 0x4a19, 0x4a0e, 0x4a06, 0x4a07, 0x4a1a, 0x4a1d, 0x4a1b, 0x4a1c, 0x68f8, 0x0007, 0x7d3f, 0x69f8, 0x0007, 0x4000, 0x68f8, 0x001d, 0xfffc, 0x4818, 0x68f8, 0x0018, 0xfffe, 0x7711, 0x0001, 0x4a08, 0x7681, 0x0800, 0x10f8, 0x031b, 0x00f8, 0x0319, 0x80f8, 0x0319, 0x7710, 0x1000, 0x7211, 0x0319, 0x10f8, 0x031b, 0xf5a9, 0xeeff, 0x00f8, 0x031a, 0xfa20, 0x0228, 0x80f8, 0x031a, 0xf074, 0x00fc, 0xee01, 0x8a18, 0xf495, 0x8a1c, 0x8a1b, 0x8a1d, 0x8a1a, 0x8a07, 0x8a06, 0x8a0e, 0x8a19, 0x8a17, 0x8a17, 0x8a16, 0x8a15, 0x8a14, 0x8a13, 0x8a12, 0x8a11, 0x8a10, 0x8a0d, 0x8a0c, 0x8a0b, 0x8a0a, 0x8a09, 0x8a08, 0xf4eb, 0x4a11, 0x7711, 0x0055, 0x76f8, 0x031a, 0x0000, 0x76f8, 0x0319, 0x0000, 0x76f8, 0x031b, 0x0000, 0x76f8, 0x031c, 0x0000, 0x76f8, 0x031e, 0x0000, 0x76f8, 0x031d, 0x0001, 0x7681, 0x0003, 0x7711, 0x0057, 0x7681, 0x2800, 0x7711, 0x0055, 0x7681, 0x0004, 0x7711, 0x0057, 0x7681, 0x7141, 0x7711, 0x0055, 0x7681, 0x0000, 0x7711, 0x0057, 0x7681, 0x8000, 0x7711, 0x0055, 0x7681, 0x0001, 0x7711, 0x0057, 0x7681, 0x0022, 0x7711, 0x0055, 0x7681, 0x0002, 0x7711, 0x0057, 0x7681, 0x1000, 0x7711, 0x0054, 0x7681, 0x0080, 0x8a11, 0xfc00, 0x4a11, 0x7711, 0x0038, 0x7681, 0x0000, 0x7711, 0x0039, 0x7681, 0x0000, 0x7711, 0x0038, 0x7681, 0x0001, 0x7711, 0x0039, 0x7681, 0x0030, 0x7711, 0x0038, 0x7681, 0x000e, 0x7711, 0x0039, 0x7681, 0x0002, 0x7711, 0x0038, 0x7681, 0x0004, 0x7711, 0x0039, 0x7681, 0x00a0, 0x7711, 0x0038, 0x7681, 0x0005, 0x7711, 0x0039, 0x7681, 0x0000, 0x8a11, 0xfc00, 0x4a11, 0x7711, 0x0038, 0x7681, 0x0001, 0x7711, 0x0039, 0x6981, 0x0001, 0x8a11, 0xfc00, 0x4a11, 0x7711, 0x0038, 0x7681, 0x0001, 0x7711, 0x0039, 0x6881, 0xfffe, 0x8a11, 0xfc00, }; static const unsigned short _section_vectors[] = { - 0xf273, 0x00df, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf273, 0x0080, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf273, 0x018e, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf273, 0x01e8, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, + 0xf273, 0x00df, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf273, 0x0080, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf273, 0x018e, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, 0xf273, 0x01e8, 0xf495, 0xf495, 0xf4eb, 0xf495, 0xf495, 0xf495, }; static const struct dsp_section dsp_image[] = { - {_section_text, 0x0080, 0x0245}, - {NULL /* .bss */, 0x02c5, 0x005a}, - {_section_vectors, 0x7f80, 0x0080}, - {NULL /* .dma */, 0x8000, 0x1000}, - {NULL, 0, 0} + {_section_text, 0x0080, 0x0245}, + {NULL /* .bss */, 0x02c5, 0x005a}, + {_section_vectors, 0x7f80, 0x0080}, + {NULL /* .dma */, 0x8000, 0x1000}, + {NULL, 0, 0} }; /* Symbol table, usable with the DSP_() macro (see dsp-target.h). */ diff --git a/firmware/target/arm/tms320dm320/dsp_image_helloworld.h b/firmware/target/arm/tms320dm320/dsp_image_helloworld.h index 6cd3352cea..b98efc85d1 100644 --- a/firmware/target/arm/tms320dm320/dsp_image_helloworld.h +++ b/firmware/target/arm/tms320dm320/dsp_image_helloworld.h @@ -21,7 +21,7 @@ */ static const struct dsp_section dsp_image_helloworld[] = { - {NULL, 0, 0} + {NULL, 0, 0} }; /* Symbol table, usable with the DSP_() macro (see dsp-target.h). */ diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c index 75e4b9e579..0debdaf098 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c @@ -69,14 +69,14 @@ void lcd_sleep() if (lcd_on) { lcd_on = false; - memset16(FRAME, 0xFFFF, LCD_WIDTH*LCD_HEIGHT); - sleep(HZ/5); + memset16(FRAME, 0xFFFF, LCD_WIDTH*LCD_HEIGHT); + sleep(HZ/5); /* Disabling these saves another ~15mA */ IO_OSD_OSDWINMD0 &= ~(0x01); - IO_VID_ENC_VMOD &= ~(0x01); - - /* Disabling the LCD saves ~50mA */ - IO_GIO_BITCLR2=1<<4; /* pin 36 */ + IO_VID_ENC_VMOD &= ~(0x01); + + /* Disabling the LCD saves ~50mA */ + IO_GIO_BITCLR2=1<<4; /* pin 36 */ } } @@ -85,11 +85,11 @@ void lcd_awake(void) /* "enabled" implies "powered" */ if (!lcd_on) { - lcd_on=true; - IO_OSD_OSDWINMD0 |= 0x01; - IO_VID_ENC_VMOD |= 0x01; - - sleep(2); + lcd_on=true; + IO_OSD_OSDWINMD0 |= 0x01; + IO_VID_ENC_VMOD |= 0x01; + + sleep(2); IO_GIO_BITSET2 = 1<<4; lcd_update(); @@ -120,8 +120,8 @@ void lcd_enable_composite(bool enable) { IO_GIO_BITCLR2 = 0x80; vidtemp |= 0x2015; - IO_VID_ENC_DCLKCTL = 0x0800; - IO_VID_ENC_DCLKPTN0 = 0x0001; + IO_VID_ENC_DCLKCTL = 0x0800; + IO_VID_ENC_DCLKPTN0 = 0x0001; } IO_VID_ENC_VMOD = vidtemp; @@ -179,40 +179,40 @@ void lcd_init_device(void) /* Clear the Frame */ memset16(FRAME, 0x0000, LCD_WIDTH*LCD_HEIGHT); - IO_OSD_OSDWINMD0 &= ~(0x0001); - IO_OSD_VIDWINMD &= ~(0x0001); - - /* Setup the LCD controller */ - IO_VID_ENC_VMOD = 0x2014; - IO_VID_ENC_VDCTL = 0x2000; - IO_VID_ENC_VDPRO = 0x0000; - IO_VID_ENC_SYNCTL = 0x100E; - IO_VID_ENC_HSPLS = 1; /* HSYNC pulse width */ - IO_VID_ENC_VSPLS = 1; /* VSYNC pulse width */ - - /* These calculations support 640x480 and 320x240 (based on OF) */ - IO_VID_ENC_HINT = LCD_NATIVE_WIDTH+LCD_NATIVE_WIDTH/3; - IO_VID_ENC_HSTART = LCD_NATIVE_WIDTH/6; /* Back porch */ - IO_VID_ENC_HVALID = LCD_NATIVE_WIDTH; /* Data valid */ - IO_VID_ENC_VINT = LCD_NATIVE_HEIGHT+8; - IO_VID_ENC_VSTART = 2; - IO_VID_ENC_VVALID = LCD_NATIVE_HEIGHT; - - IO_VID_ENC_HSDLY = 0x0000; - IO_VID_ENC_VSDLY = 0x0000; - IO_VID_ENC_YCCTL = 0x0000; - IO_VID_ENC_RGBCTL = 0x0000; - IO_VID_ENC_RGBCLP = 0xFF00; - IO_VID_ENC_LNECTL = 0x0000; - IO_VID_ENC_CULLLNE = 0x0000; - IO_VID_ENC_LCDOUT = 0x0000; - IO_VID_ENC_BRTS = 0x0000; - IO_VID_ENC_BRTW = 0x0000; - IO_VID_ENC_ACCTL = 0x0000; - IO_VID_ENC_PWMP = 0x0000; - IO_VID_ENC_PWMW = 0x0000; - - /* Setup the display */ + IO_OSD_OSDWINMD0 &= ~(0x0001); + IO_OSD_VIDWINMD &= ~(0x0001); + + /* Setup the LCD controller */ + IO_VID_ENC_VMOD = 0x2014; + IO_VID_ENC_VDCTL = 0x2000; + IO_VID_ENC_VDPRO = 0x0000; + IO_VID_ENC_SYNCTL = 0x100E; + IO_VID_ENC_HSPLS = 1; /* HSYNC pulse width */ + IO_VID_ENC_VSPLS = 1; /* VSYNC pulse width */ + + /* These calculations support 640x480 and 320x240 (based on OF) */ + IO_VID_ENC_HINT = LCD_NATIVE_WIDTH+LCD_NATIVE_WIDTH/3; + IO_VID_ENC_HSTART = LCD_NATIVE_WIDTH/6; /* Back porch */ + IO_VID_ENC_HVALID = LCD_NATIVE_WIDTH; /* Data valid */ + IO_VID_ENC_VINT = LCD_NATIVE_HEIGHT+8; + IO_VID_ENC_VSTART = 2; + IO_VID_ENC_VVALID = LCD_NATIVE_HEIGHT; + + IO_VID_ENC_HSDLY = 0x0000; + IO_VID_ENC_VSDLY = 0x0000; + IO_VID_ENC_YCCTL = 0x0000; + IO_VID_ENC_RGBCTL = 0x0000; + IO_VID_ENC_RGBCLP = 0xFF00; + IO_VID_ENC_LNECTL = 0x0000; + IO_VID_ENC_CULLLNE = 0x0000; + IO_VID_ENC_LCDOUT = 0x0000; + IO_VID_ENC_BRTS = 0x0000; + IO_VID_ENC_BRTW = 0x0000; + IO_VID_ENC_ACCTL = 0x0000; + IO_VID_ENC_PWMP = 0x0000; + IO_VID_ENC_PWMW = 0x0000; + + /* Setup the display */ IO_OSD_MODE = 0x00ff; IO_OSD_ATRMD = 0x0000; @@ -281,9 +281,9 @@ void lcd_init_device(void) IO_OSD_VIDWIN0XL = LCD_NATIVE_WIDTH; IO_OSD_VIDWIN0YL = LCD_NATIVE_HEIGHT; - IO_OSD_OSDWINMD0 |= 0x01; - - lcd_enable_composite(false); + IO_OSD_OSDWINMD0 |= 0x01; + + lcd_enable_composite(false); } #if defined(HAVE_LCD_MODES) @@ -578,9 +578,9 @@ void lcd_update(void) #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y, - int width, int height) __attribute__ ((section(".icode"))); + int width, int height) __attribute__ ((section(".icode"))); void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y, - int width, int height) + int width, int height) { #if CONFIG_ORIENTATION == SCREEN_PORTRAIT #if defined(LCD_USE_DMA) @@ -604,7 +604,7 @@ void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y, char *dst=(char *)FRAME + (LCD_NATIVE_WIDTH+LCD_FUDGE)*(LCD_NATIVE_HEIGHT-1) - (LCD_NATIVE_WIDTH+LCD_FUDGE)*x + y; - + src=src+src_x+src_y*width; while(height--) @@ -627,29 +627,29 @@ void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y, void lcd_pal256_update_pal(fb_data *palette) { - unsigned char i; - for(i=0; i< 255; i++) - { - int y, cb, cr; - unsigned char r=RGB_UNPACK_RED_LCD(palette[i])<<3; - unsigned char g=RGB_UNPACK_GREEN_LCD(palette[i])<<2; - unsigned char b=RGB_UNPACK_BLUE_LCD(palette[i])<<3; + unsigned char i; + for(i=0; i< 255; i++) + { + int y, cb, cr; + unsigned char r=RGB_UNPACK_RED_LCD(palette[i])<<3; + unsigned char g=RGB_UNPACK_GREEN_LCD(palette[i])<<2; + unsigned char b=RGB_UNPACK_BLUE_LCD(palette[i])<<3; - y = ((77 * r + 150 * g + 29 * b) >> 8); cb = ((-43 * r - 85 * g + 128 * b) >> 8) + 128; + y = ((77 * r + 150 * g + 29 * b) >> 8); cb = ((-43 * r - 85 * g + 128 * b) >> 8) + 128; cr = ((128 * r - 107 * g - 21 * b) >> 8) + 128; - + while(IO_OSD_MISCCTL&0x08) {}; - - /* Write in y and cb */ - IO_OSD_CLUTRAMYCB= ((unsigned char)y << 8) | (unsigned char)cb; - - /* Write in the index and cr */ - IO_OSD_CLUTRAMCR=((unsigned char)cr << 8) | i; - } + + /* Write in y and cb */ + IO_OSD_CLUTRAMYCB= ((unsigned char)y << 8) | (unsigned char)cb; + + /* Write in the index and cr */ + IO_OSD_CLUTRAMCR=((unsigned char)cr << 8) | i; + } } #endif - + void lcd_blit_yuv(unsigned char * const src[3], int src_x, int src_y, int stride, int x, int y, int width, @@ -665,7 +665,7 @@ void lcd_blit_yuv(unsigned char * const src[3], if (!lcd_on) return; - + /* y has to be on a 16 pixel boundary */ y &= ~0xF; @@ -703,33 +703,33 @@ void lcd_blit_yuv(unsigned char * const src[3], register int y_remain=(stride<<1)-width; do { - register fb_data *c_dst=dst; - register int c_width=width; - - do - { - /* This needs to be done in a block of 4 pixels */ - - *c_dst=*yuv_src[0]<<8 | *yuv_src[1]; - *(c_dst+1)=*(yuv_src[0]+stride)<<8 | *yuv_src[2]; - c_dst-=(LCD_NATIVE_WIDTH+LCD_FUDGE); - - yuv_src[0]++; - - *c_dst=*yuv_src[0]<<8 | *yuv_src[1]; - *(c_dst+1)=*(yuv_src[0]+stride)<<8 | *yuv_src[2]; - c_dst-=(LCD_NATIVE_WIDTH+LCD_FUDGE); - + register fb_data *c_dst=dst; + register int c_width=width; + + do + { + /* This needs to be done in a block of 4 pixels */ + + *c_dst=*yuv_src[0]<<8 | *yuv_src[1]; + *(c_dst+1)=*(yuv_src[0]+stride)<<8 | *yuv_src[2]; + c_dst-=(LCD_NATIVE_WIDTH+LCD_FUDGE); + yuv_src[0]++; - yuv_src[1]++; - yuv_src[2]++; - - c_width -= 2; - } - while (c_width > 0); - - yuv_src[0] += y_remain; /* Skip down two luma lines-width */ + *c_dst=*yuv_src[0]<<8 | *yuv_src[1]; + *(c_dst+1)=*(yuv_src[0]+stride)<<8 | *yuv_src[2]; + c_dst-=(LCD_NATIVE_WIDTH+LCD_FUDGE); + + yuv_src[0]++; + + yuv_src[1]++; + yuv_src[2]++; + + c_width -= 2; + } + while (c_width > 0); + + yuv_src[0] += y_remain; /* Skip down two luma lines-width */ yuv_src[1] += cbcr_remain; /* Skip down one chroma line-width/2 */ yuv_src[2] += cbcr_remain; dst+=2; diff --git a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c index f24be5b74f..fa8a74d880 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c @@ -51,11 +51,11 @@ void power_init(void) unsigned int power_input_status(void) { - /* Charger is active low */ - if(!(IO_GIO_BITSET1&(1<<9))) - { - return POWER_INPUT_MAIN_CHARGER; - } + /* Charger is active low */ + if(!(IO_GIO_BITSET1&(1<<9))) + { + return POWER_INPUT_MAIN_CHARGER; + } return POWER_INPUT_NONE; } -- cgit v1.2.3