Use an event flag group for GUI updates
This commit is contained in:
		@ -69,7 +69,7 @@ TX_THREAD app_thread;
 | 
			
		||||
TX_THREAD ui_thread;
 | 
			
		||||
TX_THREAD vehicle_thread;
 | 
			
		||||
TX_QUEUE gui_button_queue;
 | 
			
		||||
TX_QUEUE vehicle_update_queue;
 | 
			
		||||
TX_EVENT_FLAGS_GROUP gui_update_events;
 | 
			
		||||
/* USER CODE END PV */
 | 
			
		||||
 | 
			
		||||
/* Private function prototypes -----------------------------------------------*/
 | 
			
		||||
@ -184,15 +184,7 @@ VOID tx_application_define(VOID *first_unused_memory) {
 | 
			
		||||
    Error_Handler();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void *vehicle_update_queue_start = mem;
 | 
			
		||||
  ULONG vehicle_update_msg_size = sizeof(VehicleUpdate) / sizeof(ULONG);
 | 
			
		||||
  if (sizeof(VehicleUpdate) % sizeof(ULONG) != 0) {
 | 
			
		||||
    vehicle_update_msg_size++;
 | 
			
		||||
  }
 | 
			
		||||
  mem += VEHICLE_UPDATE_QUEUE_SIZE * vehicle_update_msg_size;
 | 
			
		||||
  if (tx_queue_create(&vehicle_update_queue, "Vehicle Update Queue",
 | 
			
		||||
                      vehicle_update_msg_size, vehicle_update_queue_start,
 | 
			
		||||
                      VEHICLE_UPDATE_QUEUE_SIZE * vehicle_update_msg_size) !=
 | 
			
		||||
  if (tx_event_flags_create(&gui_update_events, "GUI Update Events") !=
 | 
			
		||||
      TX_SUCCESS) {
 | 
			
		||||
    Error_Handler();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user