Changeset 260 for rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cpp
- Timestamp:
- Oct 23, 2016, 8:29:46 PM (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cpp
r255 r260 1 #include "r ca.h"1 #include "r2ca.h" 2 2 #include "i2c_lcd.h" 3 3 … … 36 36 "; 37 37 38 extern void task1_setup(); 39 extern void task2_setup(); 40 extern void task3_setup(); 41 extern void task4_setup(); 42 extern void task5_setup(); 43 38 44 void setup(){ 39 45 Serial.begin(115200); … … 43 49 Serial.println("Main Task : setup start!"); 44 50 Serial.println(usage); 51 52 task1_setup(); 53 task2_setup(); 54 task3_setup(); 55 task4_setup(); 56 task5_setup(); 45 57 } 46 58 … … 59 71 #define SVC_PERROR(expr) svc_perror(__FILE__, __LINE__, #expr, (expr)) 60 72 61 ID tskid = R CA_TASK1;73 ID tskid = R2CA_TASK1; 62 74 int_t tskno = 1; 63 75 … … 77 89 case '1': 78 90 tskno = 1; 79 tskid = R CA_TASK1;91 tskid = R2CA_TASK1; 80 92 syslog(LOG_INFO, "Select Sensor Task."); 81 93 break; 82 94 case '2': 83 95 tskno = 2; 84 tskid = R CA_TASK2;96 tskid = R2CA_TASK2; 85 97 syslog(LOG_INFO, "Select Web Task."); 86 98 break; 87 99 case '3': 88 100 tskno = 3; 89 tskid = R CA_TASK3;101 tskid = R2CA_TASK3; 90 102 syslog(LOG_INFO, "Select LED Task."); 91 103 break; 92 104 case '4': 93 105 tskno = 4; 94 tskid = R CA_TASK4;106 tskid = R2CA_TASK4; 95 107 syslog(LOG_INFO, "Select TFT Task."); 96 108 break; 97 109 case '5': 98 110 tskno = 5; 99 tskid = R CA_TASK5;111 tskid = R2CA_TASK5; 100 112 syslog(LOG_INFO, "Select Processing Task."); 101 113 break; … … 346 358 } 347 359 348 void task1_loop() {360 void loop1() { 349 361 static uint32_t sensor_cyc_tim = 0; 350 362 … … 554 566 555 567 556 void task2_loop()568 void loop2() 557 569 { 558 570 uint8_t buffer[128] = {0}; … … 622 634 } 623 635 624 void task3_loop() {636 void loop3() { 625 637 static bool gled1_blink_state = false; 626 638 static bool gled2_blink_state = false; … … 772 784 int loop_cnt = 0;; 773 785 774 void task4_loop() {786 void loop4() { 775 787 // don't do anything if the image wasn't loaded correctly. 776 788 if (logo.isValid() == false) { … … 833 845 #define TIMEOUT_MS 3000 834 846 835 void task5_loop()847 void loop5() 836 848 { 837 849 if(!processing_connected){ … … 848 860 uint16_t dispatch_cnt; 849 861 850 load = 100 - map(r ca_idle_result, 0, IDLE_TASK_IDLE_LOOP_10MS/10, 0, 100);851 isr_cnt = (r ca_isr_result > 0xffff)? 0xffff : rca_isr_result;852 dispatch_cnt = (r ca_dispatch_result > 0xffff)? 0xffff : rca_dispatch_result;862 load = 100 - map(r2ca_idle_result, 0, IDLE_TASK_IDLE_LOOP_10MS/10, 0, 100); 863 isr_cnt = (r2ca_isr_result > 0xffff)? 0xffff : r2ca_isr_result; 864 dispatch_cnt = (r2ca_dispatch_result > 0xffff)? 0xffff : r2ca_dispatch_result; 853 865 854 866 if (PSERIAL.available()){
Note:
See TracChangeset
for help on using the changeset viewer.