Advertisement
jh_elec

Fehlerermittlung

Jul 6th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #include <string.h>
  4. #include <windows.h>
  5.  
  6.  
  7.  
  8. typedef enum
  9. {
  10.         MAX6675_THREE_STATE         = 1<<0,
  11.         MAX6675_ID                  = 1<<1,
  12.         MAX6675_THERMOCOUPLE_INPUT  = 1<<2,
  13. }max6675_state;
  14.  
  15. max6675_state max6675getState( uint8_t in )
  16. {
  17.     return ( in & ( MAX6675_THREE_STATE | MAX6675_ID ) | MAX6675_THERMOCOUPLE_INPUT );
  18. }
  19.  
  20. int main ()
  21. {  
  22.     uint8_t fuehlerError = 1<<2;
  23.    
  24.     printf( "%d" , max6675getState( fuehlerError ) );
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement