This file contains 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
bin = 'build\\tdd.bin' | |
disk = 'F:\\' | |
copy(bin, disk) | |
sleep(1.5) | |
serial = Serial('COM8', timeout = 1) | |
serial.flushInput() | |
serial.flushOutput() | |
serial.sendBreak() | |
while True: | |
c = serial.readline() |
This file contains 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> | |
int main(void) | |
{ | |
unsigned short a = 65000; | |
unsigned short b = 540; | |
unsigned short c = 0; | |
c = a + b; | |
printf("Result is %hu + %hu = %hu\n", a, b, c); |
This file contains 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 <limits.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
assert(sizeof(short)==2); | |
unsigned short us = 0; | |
short ss = SHRT_MIN; // -32768 |
This file contains 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 <limits.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
assert(sizeof(short)==2); | |
short ss = SHRT_MIN; | |
int si = ss; |
This file contains 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 <limits.h> | |
#include <assert.h> | |
#define MAGIC_NUMBER 0xFFFF7F8F | |
int main(void) | |
{ | |
assert(sizeof(short)==2); |
This file contains 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 <limits.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
assert(sizeof(short)==2); | |
unsigned short us = 0x8080; | |
short ss = us; |
This file contains 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 <limits.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
assert(sizeof(unsigned char)==1); | |
unsigned char uc1 = 0xff; | |
unsigned char uc2 = 0; |
This file contains 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 <limits.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
assert(sizeof(unsigned char)==1); | |
unsigned char uc1 = 0xff; | |
unsigned char uc2 = 0; |
This file contains 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 <limits.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
assert(sizeof(int)==4); | |
int intMin = INT_MIN; |
This file contains 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> | |
int main(void) | |
{ | |
unsigned int ui = 16; | |
printf("%u * 16 = %u\n", ui, ui*16); | |
printf("%u << 4 = %u\n", ui, ui << 4); | |
return 0; | |
} |
OlderNewer