krnl
Data Structures | Macros | Functions | Variables
k07mutexsem-adv.ino File Reference
#include <krnl.h>
Include dependency graph for k07mutexsem-adv.ino:

Go to the source code of this file.

Data Structures

struct  shDataTp
 

Macros

#define STK   150
 

Functions

void saveDataInCritRegion (int v)
 
int saveDataInCritRegionNoWait (int v)
 
struct shDataTp getDataInCritRegion (void)
 
void t1 ()
 
void t2 ()
 
void setup ()
 
void loop ()
 

Variables

struct k_tp1
 
struct k_tp2
 
struct k_ts1
 
struct k_tsemmutex
 
struct shDataTp sharedData = {0, 0}
 
volatile int noDataDelivered = 0
 
char a1 [STK]
 
char a2 [STK]
 

Macro Definition Documentation

◆ STK

#define STK   150

Definition at line 100 of file k07mutexsem-adv.ino.

Function Documentation

◆ getDataInCritRegion()

struct shDataTp getDataInCritRegion ( void  )

Definition at line 45 of file k07mutexsem-adv.ino.

References shDataTp::counter, k_eat_msec(), k_signal(), k_wait(), semmutex, and sharedData.

Referenced by t2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop()

void loop ( )

Definition at line 130 of file k07mutexsem-adv.ino.

◆ saveDataInCritRegion()

void saveDataInCritRegion ( int  v)

Definition at line 18 of file k07mutexsem-adv.ino.

References shDataTp::counter, k_signal(), k_wait(), semmutex, sharedData, and shDataTp::v.

Here is the call graph for this function:

◆ saveDataInCritRegionNoWait()

int saveDataInCritRegionNoWait ( int  v)

Definition at line 29 of file k07mutexsem-adv.ino.

References shDataTp::counter, k_signal(), k_wait(), semmutex, sharedData, shDataTp::v, and x.

Referenced by t1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup()

void setup ( )

Definition at line 103 of file k07mutexsem-adv.ino.

References a1, a2, k_crt_sem(), k_crt_task(), k_init(), k_start(), p1, p2, s1, semmutex, STK, t1(), and t2().

Here is the call graph for this function:

◆ t1()

void t1 ( )

Definition at line 61 of file k07mutexsem-adv.ino.

References k_set_sem_timer(), k_wait(), noDataDelivered, s1, saveDataInCritRegionNoWait(), and shDataTp::v.

Referenced by setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t2()

void t2 ( )

Definition at line 80 of file k07mutexsem-adv.ino.

References getDataInCritRegion(), k_sleep(), noDataDelivered, and shDataTp::v.

Referenced by setup().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ a1

char a1[STK]

Definition at line 101 of file k07mutexsem-adv.ino.

Referenced by setup().

◆ a2

char a2[STK]

Definition at line 101 of file k07mutexsem-adv.ino.

Referenced by setup().

◆ noDataDelivered

volatile int noDataDelivered = 0

Definition at line 15 of file k07mutexsem-adv.ino.

Referenced by t1(), and t2().

◆ p1

struct k_t* p1

Definition at line 5 of file k07mutexsem-adv.ino.

Referenced by setup().

◆ p2

struct k_t * p2

Definition at line 5 of file k07mutexsem-adv.ino.

Referenced by setup().

◆ s1

struct k_t * s1

Definition at line 5 of file k07mutexsem-adv.ino.

Referenced by setup(), and t1().

◆ semmutex

struct k_t * semmutex

◆ sharedData

struct shDataTp sharedData = {0, 0}