Industrielle Fertigung
Industrielles Internet der Dinge | Industrielle Materialien | Gerätewartung und Reparatur | Industrielle Programmierung |
home  MfgRobots >> Industrielle Fertigung >  >> Industrial Internet of Things >> Eingebettet

Event Flag Groups meistern: Utility Services & Data Structures in Nucleus RTOS/SE

Event Flag Groups meistern: Utility Services & Data Structures in Nucleus RTOS/SE
View the RTOS Revealed series

Dieser Artikel setzt den Blick auf Event Flag Groups fort.

Event Flag Group Utility Services

Nucleus RTOS bietet drei dedizierte API Calls, die Interaktion mit Event Flag Groups streamlinen: Retrieval detaillierter Group Information, Erhalten der Gesamtzahl Groups, und Zugriff auf Pointer zu allen Groups innerhalb einer Applikation. Die ersten zwei Funktionen sind in Nucleus SE voll supported.

Event Flag Group Information

Dieser Service Call liefert Key Data über eine spezifizierte Event Flag Group. In Nucleus SE ist das Interface getrimmt – Object Naming und Suspend Ordering werden omitted, und Task Suspend Information wird nur zurückgegeben, wenn das Feature enabled ist.

Nucleus RTOS API Call für Event Group Information

Service Call Prototype:

STATUS NU_Event_Group_Information(NU_EVENT_GROUP *group,
CHAR *name, UNSIGNED *event_flags, UNSIGNED *tasks_waiting,
NU_TASK **first_task);

Parameter:

group – Pointer zum user-supplied Event Flag Group Control Block

name – 8-Character Buffer für den Group Namen (inklusive Null Terminator)

event_flags – Pointer zu Variable, die aktuellen Flag Wert empfängt

tasks_waiting – Pointer zu Variable, die Anzahl suspended Tasks auf dieser Group empfängt

first_task – Pointer zu NU_TASK Variable, die Pointer zum ersten suspended Task empfängt

Returns:

NU_SUCCESS – Call completed successfully

NU_INVALID_GROUP – Supplied Group Pointer ist invalid

Nucleus SE API Call für Event Group Information

Dieses API bietet die gleiche Kernfunktionalität wie sein RTOS Counterpart.

Service Call Prototype:

STATUS NUSE_Event_Group_Information(NUSE_EVENT_GROUP group,
U8 *event_flags, U8 *tasks_waiting, NUSE_TASK *first_task);

Parameter:

group – Index der Event Flag Group

event_flags – Pointer zum Empfang des aktuellen Flag Werts

tasks_waiting – Pointer zum Empfang der Anzahl suspended Tasks (0 falls Task Suspend disabled)

first_task – Pointer zum Empfang des Index des ersten suspended Tasks (0 falls Task Suspend disabled)

Returns:

NUSE_SUCCESS – Call completed successfully

NUSE_INVALID_GROUP – Group Index ist invalid

Nucleus SE Implementation of Event Group Information

Die Implementation ist straightforward: Der aktuelle Flag Wert wird gelesen, und wenn Blocking APIs enabled sind, werden Waiting-Task Count und First-Task Index computed; andernfalls werden beide auf 0 gesetzt.

*event_flags = NUSE_Event_Group_Data[group];#if NUSE_BLOCKING_ENABLE *tasks_waiting = NUSE_Event_Group_Blocking_Count[group]; if (NUSE_Event_Group_Blocking_Count[group] != 0) { U8 index; for (index=0; index

Anzahl der Event Flag Groups erhalten

In Nucleus RTOS kann die Anzahl Groups dynamisch wechseln; der Call returned den aktuellen Count. In Nucleus SE ist der Count zur Build Time fixiert.

Nucleus RTOS API Call für Event Flag Group Count

Service Call Prototype:

UNSIGNED NU_Established_Event_Groups(VOID);

Returns:

Die aktuelle Anzahl erstellter Event Flag Groups in der Applikation

Nucleus SE API Call für Event Flag Group Count

Service Call Prototype:

U8 NUSE_Event_Group_Count(void);

Returns:

Die Anzahl konfigurierter Event Flag Groups in der Applikation

Nucleus SE Implementation of Event Flag Group Count

Die Funktion returned einfach den Wert der Compile-Time Constant NUSE_EVENT_GROUP_NUMBER.

Eingebettet

  1. Cloud vs. In-House Server: Die richtige Hosting-Lösung wählen
  2. Microsoft Azure kündigt Blockchain-Tokenisierung & Data Management Services an
  3. C++ Structures vs. Classes: Praktischer Leitfaden für Embedded-Entwickler
  4. Mailboxes in Nucleus SE: Praktischer Guide zu Konfiguration und Nutzung
  5. Semaphores in Nucleus RTOS: Utility Services & Data Structures
  6. Semaphores in Nucleus SE: Überblick, Konfiguration und API Essentials
  7. Event Flag Groups in Nucleus SE: Einführender Guide zu Konfiguration und API Usage
  8. Queues in Nucleus SE: Einführung und Core Service Calls
  9. Apacer bringt globale CV110-SD & CV110-MSD High-Performance Flash-Karten
  10. OpenHW Group startet CORE-V Familie Open-Source Prozessor-Kerne