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
type | |
TTEA_InOut = array[0..7] of byte; | |
TTEA_Key = array[0..15] of byte; | |
var | |
TEA_InitKey : TTEA_Key = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); | |
TEA_InitData : TTEA_InOut = ($0a,$3a,$ea,$41,$40,$a9,$ba,$94); | |
type | |
TTeaArray = array [0 .. 1] of Cardinal; |
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
#pragma once | |
#include <SDKDDKVer.h> | |
#define WIN32_LEAN_AND_MEAN | |
#define NOMINMAX | |
#include <windows.h> | |
#include <tchar.h> | |
#include <shellapi.h> | |
#include <string> | |
#include <sstream> | |
#include <functional> |
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
Cortex debug condition assertion | |
Used to popular ASSERT(condition) macro? Code below stops on faulty condition when debugging Cortex CPU. BE CAREFUL: use code build with _DEBUG or DEBUG define when debugging BUT DON'T use same code without debugger. | |
#if defined ( _DEBUG ) || defined ( DEBUG ) | |
#define ASSERT(expr) { if ( !(expr) ) { __ASM__(" bkpt #0"); } } | |
#else | |
#define ASSERT(...) { } | |
#endif | |
Usage: |
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
/** | |
* \typedef CDCDSerialDriverConfigurationDescriptors | |
* \brief Configuration descriptor list for a device implementing a | |
* CDC serial driver. | |
*/ | |
typedef struct _CDCDSerialDriverConfigurationDescriptors { | |
/** Standard configuration descriptor. */ | |
USBConfigurationDescriptor configuration; | |
/** Communication interface descriptor. */ |
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
TextPad will allow you to perform this operation. | |
example: | |
test this sentence | |
Find what: \([^ ]*\) \(.*\) Replace with: \U\1\E \2 | |
the \U will cause all following chars to be upper | |
the \E will turn off the \U |
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
/********************************************************************** | |
* | |
* OS_malloc | |
* | |
*********************************************************************** | |
Purpose: | |
*/ | |
void* OS_malloc(unsigned int Size) { |
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
#define LSB(hword) (((uint8_t *)&(hword))[1]) // Least significant byte of hword. | |
#define MSB(hword) (((uint8_t *)&(hword))[0]) // Most significant byte of hword. | |
#define LSH(word) (((uint16_t *)&(word))[1]) // Least significant half-hword of word. | |
#define MSH(word) (((uint16_t *)&(word))[0]) // Most significant half-hword of word. | |
#define LSW(dword) (((uint32_t *)&(dword))[1]) // Least significant hword of dword. | |
#define MSW(dword) (((uint32_t *)&(dword))[0]) // Most significant hword of dword. | |
#define MSB0W(word) (((uint8_t *)&(word))[0]) // Most significant byte of 1st rank of word. |
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
#if BYTE_ORDER == __ORDER_BIG_ENDIAN__ | |
//Host byte order to network byte order (at compile time) | |
#define HTONS(value) (value) | |
#define HTONL(value) (value) | |
//Network byte order to host byte order (at compile time) | |
#define NTOHS(value) (value) | |
#define NTOHL(value) (value) |
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
// https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/Unnamed-Fields.html | |
#include <stdint.h> | |
typedef union | |
{ | |
uint8_t s8; | |
struct { | |
uint8_t b0 : 1; | |
uint8_t b1 : 1; |
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
BF_XFER_0 = BF_XFER_BLACKNESS, // BLACKNESS ---------- Dst < 0 : BitFieldClr | |
BF_XFER_1 = BF_XFER_WHITENESS, // WHITENESS ---------- Dst < 1 : BitFieldSet | |
BF_XFER_BLACKNESS = 0UL, // BLACKNESS ---------- Dst < 0 : BitFieldClr | |
BF_XFER_DN = BF_XFER_DSTINVERT, // DSTINVERT ---------- Dst ^ 1 : BitFieldInv | |
BF_XFER_DSA = BF_XFER_SRCAND, // SRCAND ------------- Src & Dst | |
BF_XFER_DSNO = BF_XFER_MERGEPAINT, // MERGEPAINT --------- ~Src | Dst | |
BF_XFER_DSO = BF_XFER_SRCPAINT, // SRCPAINT ----------- Src | Dst | |
BF_XFER_DSON = BF_XFER_NOTSRCERASE, // NOTSRCERASE -------- ~(Src | Dst) | |
BF_XFER_DSTINVERT, // DSTINVERT ---------- Dst ^ 1 : BitFieldInv | |
BF_XFER_DSX = BF_XFER_SRCINVERT, // SRCINVERT ---------- Src ^ Dst |
OlderNewer