This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| typedef enum{ | |
| TYPE1READER, | |
| TYPE2READER | |
| }readerInfo; | |
| class reader | |
| { | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| //#define NDEBUG // enable this macro to disable system default asserts not for static_asserts(use above assert.h) | |
| #include<assert.h> | |
| #define VALUE 0 | |
| #define ASSERT(exp)(exp ? : assertfailed(__FILE__, __LINE__, #exp)) | |
| void assertfailed(const char *filename, int line, const char *expression) | |
| { | |
| printf("[ERROR]: error in assert: %s, line: %d, of following exp: %s\n",filename,line,expression); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Online C compiler to run C program online | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stddef.h> | |
| #include <stdbool.h> | |
| typedef uint8_t err_ret; | |
| void ExtFlash_init(void); | |
| void Rtc_init(void); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| typedef union { | |
| uint8_t data; | |
| struct { | |
| uint8_t bit0:1; //only one bit will be assigned by using ":1" | |
| uint8_t bit1:1; | |
| uint8_t bit2:1; | |
| uint8_t bit3:1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| typedef void (*callBack_t) (int); | |
| typedef struct{ | |
| callBack_t fnToCallBck; | |
| int statusCntrl; | |
| }callBckParam_t; | |
| void intrptClbckFnOne(int statusRecv){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define FNCALL {30,20,&printValueB} //Assigning values to array using Macros | |
| typedef void (*ptrFunction)(int); | |
| typedef struct{ | |
| int inputValA; | |
| int inputValB; | |
| ptrFunction fnToCall; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Online C compiler to run C program online | |
| #include <stdio.h> | |
| int main() { | |
| int a = 0b0101010101110001; | |
| int count_bits =0; | |
| for(int i=0;i<(sizeof(int)*8);i++){ | |
| int mask = 1<<i; | |
| if(a & mask){ | |
| count_bits = count_bits + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| float byte_to_float(unsigned char *const buf){ | |
| float f; | |
| memcpy(&f, buf, sizeof(float)); | |
| return f; | |
| } | |
| int main(int argc, char *argv[]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define min(a,b) ((a<b)?("less\n"):("greater\n")) | |
| int main() { | |
| printf(min(3,1)); | |
| printf("File :%s\n", __FILE__ ); | |
| printf("Date :%s\n", __DATE__ ); | |
| printf("Time :%s\n", __TIME__ ); | |
| printf("Line :%d\n", __LINE__ ); | |
| printf("STDC :%d\n", __STDC__ ); | |
| return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| typedef unsigned char uint8_t; | |
| uint8_t setbit(uint8_t _val,uint8_t _bit) | |
| { | |
| uint8_t mask = 1<<(_bit-1); | |
| return (mask | _val); | |
| } | |
| int main() { | |
| uint8_t hext_data = 0x00; |
NewerOlder