Skip to content

Commit

Permalink
Corrections days before presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fquinto committed Nov 9, 2013
1 parent 32f5f0b commit 1633c31
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 16 deletions.
9 changes: 8 additions & 1 deletion CodigoFuente/AVNET_FPGA/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,20 @@ static void AppTaskFirst (void *p_arg)
/* de codi corresponent a la funció m */

int led = 0; // S3A400 - initialize LED selector

setEDaddress();
OSTimeDlyHMSM(0,0,0,500); // Release the CPU (every 500ms)
setAPaddress();
OSTimeDlyHMSM(0,0,0,500); // Release the CPU (every 500ms)
setEDconfig();
OSTimeDlyHMSM(0,0,0,500); // Release the CPU (every 500ms)

while (1) {
if (DEBUG)
xil_printf("DEBUG: INSIDE AppTaskFirst while\n\r");
//BSP_LEDToggle(led + 1); // S3A400 - Light selected LED, all others off

OSTimeDlyHMSM(0,0,5,0); // Release the CPU (every 5 second)
OSTimeDlyHMSM(0,0,3,0); // Release the CPU (every 1 second)

//led = (led + 1) % LEDS; // S3A400 - Select next LED
}
Expand Down
57 changes: 51 additions & 6 deletions CodigoFuente/AVNET_FPGA/bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void BSP_LEDOff (INT8U led)

led_status = XGpio_ReadReg(BSP_GPIO_ADDR,1);

OS_ENTER_CRITICAL();
//OS_ENTER_CRITICAL();
switch (led) {
case 0:
led_status &= ~0x0000000F;
Expand All @@ -150,7 +150,7 @@ void BSP_LEDOff (INT8U led)
XGpio_WriteReg(BSP_GPIO_ADDR,1,led_status);
break;
}
OS_EXIT_CRITICAL();
//OS_EXIT_CRITICAL();
}

/*
Expand Down Expand Up @@ -967,7 +967,7 @@ void RecvHandlerMSP430(void *CallBackRef, unsigned int EventData)

/* DEBUG: print buffer */
/*
for (Index = 0; Index < newBuffer; Index++) {
for (Index = 0; Index <= newBuffer; Index++) {
if ( (ReceiveBuffer[Index]!=0x0D) && (ReceiveBuffer[Index]!=0x0A) )
{
xil_printf("%c",ReceiveBuffer[Index]);
Expand Down Expand Up @@ -1121,7 +1121,7 @@ void RecvHandlerUSB(void *CallBackRef, unsigned int EventData)
}

/* print buffer */
for (Index = 0; Index < newBuffer; Index++) {
for (Index = 0; Index <= newBuffer; Index++) {
if (ReceiveBuffer[Index]==0x0D)
{
//xil_printf(" (0x0D");
Expand Down Expand Up @@ -1178,7 +1178,7 @@ void enviaMSP430(u8 data2MSP430[])
/* send using MPS430 UART */
if (DEBUG)
xil_printf("DEBUG: enviaMSP430 start send\n\r");
for (Index = 0; Index < newBuffer; Index++) {
for (Index = 0; Index <= newBuffer; Index++) {
XUartLite_SendByte(XPAR_MSP430_UART_BASEADDR,data2MSP430[Index]);
}

Expand Down Expand Up @@ -1376,7 +1376,7 @@ void procesa_comandos(void)
if (DEBUG)
xil_printf("DEBUG: procesa_comandos SendBuffer\n\r");

for (Index = 0; Index < newBuffer; Index++) {
for (Index = 0; Index <= newBuffer; Index++) {
ReceiveBuffer[Index] = SendBuffer[Index];
}
//enviaMSP430(SendBuffer);
Expand All @@ -1387,6 +1387,51 @@ void procesa_comandos(void)
}
}

void setEDaddress(void)
{
// set ED address
sSendUARTMSP430Sem=1;
ReceiveBuffer[0] = 0x4C; // L;
ReceiveBuffer[1] = 0x57; // W;
ReceiveBuffer[2] = 0x36; // 6;
ReceiveBuffer[3] = 0x30; // 0;
ReceiveBuffer[4] = 0x31; // 1;
ReceiveBuffer[5] = 0x32; // 2;
ReceiveBuffer[6] = 0x33; // 3;
ReceiveBuffer[7] = 0x0d; // \r;
enviaMSP430(ReceiveBuffer);
}

void setAPaddress(void)
{
// set AP address
sSendUARTMSP430Sem=1;
ReceiveBuffer[0] = 0x4C; // L;
ReceiveBuffer[1] = 0x57; // W;
ReceiveBuffer[2] = 0x36; // 6;
ReceiveBuffer[3] = 0x31; // 1;
ReceiveBuffer[4] = 0x61; // a;
ReceiveBuffer[5] = 0x62; // b;
ReceiveBuffer[6] = 0x63; // c;
ReceiveBuffer[7] = 0x0d; // \r;
enviaMSP430(ReceiveBuffer);
}

void setEDconfig(void)
{
// config as ED
sSendUARTMSP430Sem=1;
ReceiveBuffer[0] = 0x4C; // L;
ReceiveBuffer[1] = 0x57; // W;
ReceiveBuffer[2] = 0x36; // 6;
ReceiveBuffer[3] = 0x32; // 2;
ReceiveBuffer[4] = 0x30; // 0;
ReceiveBuffer[5] = 0x30; // 0;
ReceiveBuffer[6] = 0x30; // 0;
ReceiveBuffer[7] = 0x0d; // \r;
enviaMSP430(ReceiveBuffer);
}

/*
*********************************************************************************************************
* BSP_InitIO()
Expand Down
6 changes: 4 additions & 2 deletions CodigoFuente/AVNET_FPGA/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* The following constant controls the length of the buffers to be sent
* and received with the UartLite device.
*/
#define TEST_BUFFER_SIZE 9
#define TEST_BUFFER_SIZE 8

/*
* The following constant defines the address of the IIC
Expand Down Expand Up @@ -116,7 +116,9 @@ void RecvHandlerUSB(void *CallBackRef, unsigned int EventData);
// MSP430 and USB UART END

void procesa_comandos(void);

void setEDaddress(void);
void setAPaddress(void);
void setEDconfig(void);
/*
*********************************************************************************************************
* Variable Definitions
Expand Down
12 changes: 6 additions & 6 deletions CodigoFuente/MSP430/main_TOT.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void main (void)
UART_write((char *)headResponseData, 1 );
serial_log( "R1200" );
UART_write((char *)chardata, 1 );
serial_log( "\r\n" );
serial_log( "\r" );
break;
case 0x46: // mensaje F (6): AP->FG => emisor RADIO
toRadio( "FR1200x\r" );
Expand All @@ -386,7 +386,7 @@ void main (void)
UART_write((char *)headResponseData, 1 );
serial_log( "R1200" );
UART_write((char *)chardata, 1 );
serial_log( "\r\n" );
serial_log( "\r" );
break;
case 0x47: // mensaje G (7): ED->PC => emisor RADIO
toRadio( "GR1200x\r" );
Expand Down Expand Up @@ -754,12 +754,12 @@ static void fromRadio( int byte )
case 0x47: // mensaje G (7): ED->PC => transporte RADIO2UART
//serial_log( "ED->PC\r\n" ); // debug
UART_write( dataFromRADIO, SIZE_MENSAJE );
serial_log( "\r\n" );
serial_log( "\r" );
break;
case 0x4A: // mensaje J (10): FG->PC => transporte RADIO2UART
//serial_log( "FG->PC\r\n" ); // debug
UART_write( dataFromRADIO, SIZE_MENSAJE );
serial_log( "\r\n" );
serial_log( "\r" );
break;
case 0x4B: // mensaje K (11): FG->AP => receptor RADIO
//serial_log( "FG->AP\r\n" ); // debug
Expand All @@ -781,12 +781,12 @@ static void fromRadio( int byte )
case 0x43: // mensaje C (3): PC->FG => transporte RADIO2UART
//serial_log( "PC->FG\r\n" ); // debug
UART_write( dataFromRADIO, SIZE_MENSAJE );
serial_log( "\r\n" );
serial_log( "\r" );
break;
case 0x46: // mensaje F (6): AP->FG => transporte RADIO2UART
//serial_log( "AP->FG\r\n" ); // debug
UART_write( dataFromRADIO, SIZE_MENSAJE );
serial_log( "\r\n" );
serial_log( "\r" );
break;
default: ;
}
Expand Down
2 changes: 1 addition & 1 deletion CodigoFuente/web/css/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -3761,7 +3761,7 @@ input[type="submit"].btn.btn-mini {

.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
width: 980px;
}

.navbar-fixed-top {
Expand Down
20 changes: 20 additions & 0 deletions CodigoFuente/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ function check_port(query)
</script>
</head>
<body>
<style>
/*
#svg {
width: 500px;

}
*/
.row-fluid .span6 {
width: 40.93617%;
}
svg {
position: relative;
width: 541px;
height: 376px;
left: 4px;
top: 61px;
}
</style>
<?php include("menu.php"); ?>
<div class="container">
<div class="row-fluid">
Expand Down Expand Up @@ -109,6 +127,7 @@ function check_port(query)
</div>
</div> <!-- /span6 -->
<div class="span6">
<div id="svg">
<?php
// get contents of a image file (SVG) into a string
$filename = "imagen/portada_web.svg";
Expand All @@ -121,6 +140,7 @@ function check_port(query)
fclose($handle);
echo $contents;
?>
</div> <!-- /svg -->
</div> <!-- /span6 -->
</div> <!-- /row -->
</div> <!-- /hero-unit -->
Expand Down

0 comments on commit 1633c31

Please sign in to comment.