- Timestamp:
- 02/01/10 22:01:35 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/Common/Minimal/flash.c
r34 r42 66 66 #include "task.h" 67 67 68 69 #include "FreeRTOS.h" 70 #include "semphr.h" 71 #include "task.h" 72 //#include "MetersIncludes.h" 73 68 74 /* Demo program include files. */ 69 75 #include "partest.h" 70 76 #include "flash.h" 77 78 #include "emac.h" 79 #include "partest.h" 80 #include "portlcd.h" 81 #include "flash.h" 82 83 84 char meterMsg[] = "BLBL1234567"; 85 86 extern xQueueHandle xLCDQueue; 87 xLCDMessage xMessage; 88 extern lcdText; 89 int testValue = 0; 71 90 72 91 #define ledSTACK_SIZE configMINIMAL_STACK_SIZE … … 101 120 unsigned portBASE_TYPE uxLED; 102 121 122 103 123 /* The parameters are not used. */ 104 124 ( void ) pvParameters; … … 132 152 vParTestToggleLED( uxLED ); 133 153 154 LCD_cls(); 155 xMessage.xColumn = 0; 156 xMessage.pcMessage = &meterMsg[0]; 157 itoa(testValue, &(meterMsg[0]), 10); 158 //testValue++; 159 160 // xMessage.pcMessage = "FAIL"; 161 xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY ); 162 163 164 134 165 /* Delay for half the flash period then turn the LED off. */ 135 166 vTaskDelayUntil( &xLastFlashTime, xFlashRate ); webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c
r37 r42 16 16 portBASE_TYPE Init_P2_0(void); 17 17 void basementGasCalculation(void); 18 19 xLCDMessage xMessage; 20 char lcdText[] = "a "; 21 18 22 19 23 portLONG basementGasReading = 0; … … 39 43 // TODO: put this in again, right now it interferes with Solar UART3! 40 44 45 xMessage.pcMessage = &(lcdText[0]); 41 46 42 47 for( ;; ) … … 101 106 IO2_INT_EN_F &= ~(1<<10); /* disable falling edge interrupt for P2:10 */ 102 107 108 IO2_INT_EN_R |= (1<<0); /* enable rising edge interrupt for P2:0 */ 109 IO2_INT_EN_F &= ~(1<<0); /* disable falling edge interrupt for P2:0 */ 110 IO2_INT_EN_R |= (1<<1); /* enable rising edge interrupt for P2:1 */ 111 IO2_INT_EN_F &= ~(1<<1); /* disable falling edge interrupt for P2:1 */ 112 IO2_INT_EN_R |= (1<<2); /* enable rising edge interrupt for P2:2 */ 113 IO2_INT_EN_F &= ~(1<<2); /* disable falling edge interrupt for P2:2 */ 114 IO2_INT_EN_R |= (1<<3); /* enable rising edge interrupt for P2:3 */ 115 IO2_INT_EN_F &= ~(1<<3); /* disable falling edge interrupt for P2:3 */ 116 IO2_INT_EN_R |= (1<<4); /* enable rising edge interrupt for P2:4 */ 117 IO2_INT_EN_F &= ~(1<<4); /* disable falling edge interrupt for P2:4 */ 118 103 119 VICVectAddr17 = (portLONG) vP2_0_ISR_Wrapper; /* EINT-3 interrupt handler */ 104 120 webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c
r32 r42 4 4 #include "MetersIncludes.h" 5 5 6 7 #include "emac.h" 8 #include "partest.h" 9 #include "portlcd.h" 10 #include "flash.h" 11 6 12 extern xMetersSemaphore; 7 13 extern xTickCount; /* millisecond tick counter */ 8 14 9 void handleGasMeterTick(void); 15 16 int globalValue = 0; 17 18 void handleMeterTick(portSHORT portNum); 10 19 11 20 /* The interrupt entry point. */ … … 18 27 void vP2_0_ISR_Handler( void ) 19 28 { 29 extern int testValue; 20 30 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; 21 31 22 if ((IO2_INT_STAT_R & (1 << 10)) != 0) /* P2.10 interrupt triggered */ 32 testValue++; 33 if ((IO2_INT_STAT_R & (1 << 10)) != 0) /* P2.10 interrupt triggered - SPI Load Switch */ 23 34 { 24 handleGasMeterTick(); 35 handleMeterTick(10); 36 IO2_INT_CLR |= (1<<10); 25 37 } 26 // else if ((IO2_INT_STAT_R & (1 << n)) != 0) /* some other interrupt triggered*/38 else if ((IO2_INT_STAT_R & (1 << 0)) != 0) /* P0.0 interrupt triggered - connector J4, Pin 0*/ 27 39 { 28 ; 40 handleMeterTick(0); 41 IO2_INT_CLR |= (1<<0); 42 } 43 else if ((IO2_INT_STAT_R & (1 << 1)) != 0) /* P0.1 interrupt triggered - connector J4, Pin 1*/ 44 { 45 handleMeterTick(1); 46 IO2_INT_CLR |= (1<<1); 47 } 48 else if ((IO2_INT_STAT_R & (1 << 2)) != 0) /* P0.2 interrupt triggered - connector J4, Pin 2*/ 49 { 50 handleMeterTick(2); 51 IO2_INT_CLR |= (1<<2); 52 } 53 else if ((IO2_INT_STAT_R & (1 << 3)) != 0) /* P0.3 interrupt triggered - connector J4, Pin 3*/ 54 { 55 handleMeterTick(3); 56 IO2_INT_CLR |= (1<<3); 57 } 58 else if ((IO2_INT_STAT_R & (1 << 4)) != 0) /* P0.4 interrupt triggered - connector J4, Pin 4*/ 59 { 60 handleMeterTick(4); 61 IO2_INT_CLR |= (1<<4); 29 62 } 30 63