Embedded Systems (Notes)

  • Critical Section of the Code {Producer-Consumer Problem} can be solved using “Inter Process Communication”

Semaphores is one of the primitive kernel recourses available to solve the inter process communication. Semaphore is a protected variable or ADT that provides simple but useful abstraction for controlling access by multiple process to a common resource in parallel programming environment.

Mutex : Provides Mutual Exclusion / Locking Mechanism

  • Binary Semaphores are regarded as Mutex
  •  (Counting Semaphores / Binary Semaphores)
  • Prevent dreadlocks

  • Volatile :  Keyword “Volatile” is used whenever the value of variable might change adruptly. A variable should be declared as volatile on following cases,

Notes:

  • Memory mapped peripheral registers

  • Global Variables modified by ISR

  • Global Variable accessed by multiple tasks with multi threaded application

  • Const : The **const **modifier allows you to assign an initial value to a variable that cannot be changed later.

  • Static : The static modifier tells a function or data elements are only within the scope of the current compiler.

  • Passing Data to a function

  • Pass By Reference

  • Pass By Value (& Represents Pass by Reference)

  • UART (Start Bit, Data [8 Bit], Stop Bit)