OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /gecko3/trunk/GECKO3COM/gecko3com-fw/firmware/src
    from Rev 9 to Rev 13
    Reverse comparison

Rev 9 → Rev 13

/spi_flash.c
42,6 → 42,7
#include "debugprint.h"
#include "stdint.h"
 
 
SPI_flash xdata flash_dr;
 
 
69,7 → 70,7
// Hardware enables are active low.
 
if(count_bits8(enables) > 1) {
//print_info("en\n");
//print_error("en\n");
return;
}
else {
78,13 → 79,18
enables &= bmSPI_CS_MASK;
SPI_CS_PORT |= bmSPI_CS_MASK; //disable all chipselect signals
SPI_CS_PORT &= ~enables;
SPI_CS_OE |= enables;
//SPI_CS_OE |= enables;
SPI_CS_OE |= bmSPI_CS_MASK;
}
}
 
 
/** disables all SPI devices and sets the SPI and SPI CS signals to tri-state */
#define disable_all() {setup_enables (0); SPI_OE &= ~bmSPI_MASK;}
#define disable_all() { \
setup_enables (0); \
} /* SPI_OE &= ~bmSPI_MASK; \
SPI_CS_OE &= ~bmSPI_CS_MASK; \
} */
 
 
/** \brief Internal: Writes one byte to the SPI bus
165,7 → 171,7
bitSPI_MOSI = 0; /* idle state has CLK = 0 */
 
ptrCheck(flashPtr);
 
setup_enables(bmSPI_CS_FLASH);
write_byte_msb(RDID);
read_bytes_msb (flashID, 3);
219,6 → 225,8
}
else {
return UNSUPPORTED_TYPE;
/* debug stuff: */
//return *idPtr;
}
}
 
233,8 → 241,9
//print_info("r\n");
 
/* we do a bit dirty programming here:
* the adress of the device is only 24bit long, so we misuse the upper 8bits to send the
* read command to the spi flash. this avoids more complicated constructs. */
* the adress of the device is only 24bit long, so we misuse the upper 8bits
* to send the read command to the spi flash.
* this avoids more complicated constructs. */
*adress &= 0x00FFFFFF;
*adress |= 0x03000000; //set the upper 8bit to the READ command
 
264,8 → 273,9
disable_all();
 
/* we do a bit dirty programming here:
* the adress of the device is only 24bit long, so we misuse the upper 8bits to send the
* read command to the spi flash. this avoids more complicated constructs. */
* the adress of the device is only 24bit long, so we misuse the upper 8bits
* to send the read command to the spi flash.
* this avoids more complicated constructs. */
*adress &= 0x00FFFFFF;
*adress |= 0xD8000000; //set the upper 8bit to the SE (sector erase) command
 
327,8 → 337,9
//printf_tiny("%d\n",writeableBytes);
 
/* we do a bit dirty programming here:
* the adress of the device is only 24bit long, so we misuse the upper 8bits to send the
* read command to the spi flash. this avoids more complicated constructs. */
* the adress of the device is only 24bit long, so we misuse the upper 8bits
* to send the read command to the spi flash.
* this avoids more complicated constructs. */
*adress &= 0x00FFFFFF;
*adress |= 0x02000000; //set the upper 8bit to the PP (page programm) command
/gecko3com_main.c
306,10 → 306,10
/* select which file slot we have to delete */
if(buffer[*offset] == '0') {
flash_adress = START_ADRESS_SLOT0;
flash_adress = start_adress_slot0(flash_dr);
}
else if(buffer[*offset] == '1'){
flash_adress = START_ADRESS_SLOT1;
flash_adress = start_adress_slot1(flash_dr);
}
else {
//print_err("slot\n");
405,10 → 405,10
/* select which file slot we have to delete */
slot = buffer[*offset];
if(slot == '0') {
flash_adress = START_ADRESS_SLOT0;
flash_adress = start_adress_slot0(flash_dr);
}
else if(slot == '1'){
flash_adress = START_ADRESS_SLOT1;
flash_adress = start_adress_slot1(flash_dr);
}
else {
//print_err("del\n");
575,6 → 575,7
 
buffer = EP2FIFOBUF;
scpi_scanner.action = NOACTION;
index = 0;
 
while (1){
 
947,11 → 948,11
/* read which configuration, the first or second, we should use */
if(get_switch()){
led_color = GREEN;
spi_base_adress = START_ADRESS_SLOT0;
spi_base_adress = start_adress_slot0(flash_dr);
}
else {
led_color = RED;
spi_base_adress = START_ADRESS_SLOT1;
spi_base_adress = start_adress_slot1(flash_dr);
}
/* read the configuration file size from the spi flash */
962,6 → 963,11
((idata uint8_t*)&file_size)[3] = response_queue.buf[3];
spi_base_adress += 4;
 
/* debug stuff */
response_queue.buf[0] = init_spiflash(&flash_dr);
IEEE488_set_mav();
response_queue.length = 1;
 
/* there is nothing to configure when the filesize is 0 or 0xFFFFFFFF */
if(file_size == 0 || file_size == 0xFFFFFFFF) {
/* show that we don't load a config */
/gecko3com Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/usb_tmc.c
274,8 → 274,10
usb_tmc_status = TMC_STATUS_SUCCESS;
{
uint8_t i = 0;
code char *local_capabilities = &((code char)USB_TMC_CAPABILITIES);
for(i;i<0x18;i++){
EP0BUF[i] = (&(uintptr_t)USB_TMC_CAPABILITIES)[i];
//EP0BUF[i] = (&(uintptr_t)USB_TMC_CAPABILITIES)[i];
EP0BUF[i] = local_capabilities[i];
}
EP0BCH = 0;
EP0BCL = 0x18;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.