//-----------------------------------------------------------------------------
// bitshift_demoII.c
//
// some small code snips
// demonstrationg how to use bitmasks
//
// group: group 1,13 study assistant AltiHar
//
// author: Altinger Harald 0630xxx
//
// last change: created all (Altinger Harald)
//-----------------------------------------------------------------------------
//

#include <stdio.h>

//forward declaration
int getCurrentValue();

//----------------------------------------------------------------------------- 
/// 
/// main function to controll the program flow
/// 
/// @return int  always zero 
// 
int main()
{
  int spin_on = 0x10;
  int spin_off = 0x00;
  
  //profing if spinned down
  if(spin_off & getCurrentValue())
    printf("spinn on\n");
  else
    printf("spin off\n");     
    
  //switching spin on if spined down
  if(spin_on & getCurrentValue())
    printf("already running\n");
  else
    printf("spinning up\n");     
      
  return 0;
}

//----------------------------------------------------------------------------- 
/// 
/// getCurrentValue()
/// in reality function will get value from hardware
/// 
/// @return int  hardware statusbit 
// 
int getCurrentValue()
{
  return 0x00;
}

