diff --git a/CodigoFuente/AVNET_FPGA/application.c b/CodigoFuente/AVNET_FPGA/application.c index 7abe04f..69f53aa 100644 --- a/CodigoFuente/AVNET_FPGA/application.c +++ b/CodigoFuente/AVNET_FPGA/application.c @@ -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 } diff --git a/CodigoFuente/AVNET_FPGA/bsp.c b/CodigoFuente/AVNET_FPGA/bsp.c index 2f838d6..fe34cb0 100644 --- a/CodigoFuente/AVNET_FPGA/bsp.c +++ b/CodigoFuente/AVNET_FPGA/bsp.c @@ -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; @@ -150,7 +150,7 @@ void BSP_LEDOff (INT8U led) XGpio_WriteReg(BSP_GPIO_ADDR,1,led_status); break; } - OS_EXIT_CRITICAL(); + //OS_EXIT_CRITICAL(); } /* @@ -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]); @@ -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"); @@ -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]); } @@ -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); @@ -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() diff --git a/CodigoFuente/AVNET_FPGA/bsp.h b/CodigoFuente/AVNET_FPGA/bsp.h index 3d4e86f..2ac5717 100644 --- a/CodigoFuente/AVNET_FPGA/bsp.h +++ b/CodigoFuente/AVNET_FPGA/bsp.h @@ -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 @@ -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 diff --git a/CodigoFuente/MSP430/main_TOT.c b/CodigoFuente/MSP430/main_TOT.c index 29c5947..727a6fe 100644 --- a/CodigoFuente/MSP430/main_TOT.c +++ b/CodigoFuente/MSP430/main_TOT.c @@ -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" ); @@ -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" ); @@ -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 @@ -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: ; } diff --git a/CodigoFuente/web/css/bootstrap.css b/CodigoFuente/web/css/bootstrap.css index bb40c85..6aea925 100644 --- a/CodigoFuente/web/css/bootstrap.css +++ b/CodigoFuente/web/css/bootstrap.css @@ -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 { diff --git a/CodigoFuente/web/index.php b/CodigoFuente/web/index.php index 2754416..a87352b 100644 --- a/CodigoFuente/web/index.php +++ b/CodigoFuente/web/index.php @@ -52,6 +52,24 @@ function check_port(query)
+