update macros and headers
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"io.h": "c",
|
"io.h": "c",
|
||||||
"delay.h": "c"
|
"delay.h": "c",
|
||||||
|
"interrupt.h": "c"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
// mathematics
|
// mathematics
|
||||||
#define DIV_ROUND_CLOSEST(n, d) ((((n) < 0) == ((d) < 0)) ? (((n) + (d)/2)/(d)) : (((n) - (d)/2)/(d))) // https://stackoverflow.com/a/18067292
|
#define DIV_ROUND_CLOSEST(n, d) ((((n) < 0) == ((d) < 0)) ? (((n) + (d)/2)/(d)) : (((n) - (d)/2)/(d))) // https://stackoverflow.com/a/18067292
|
||||||
|
|
||||||
|
// text
|
||||||
|
#define SWITCH_CASE(ch) (((ch) >= 'A' && (ch) <= 'Z') || ((ch) >= 'a' && (ch) <= 'z') ? ((ch) ^ (1 << 5)) : (ch))
|
||||||
|
|
||||||
// stringify
|
// stringify
|
||||||
#define STRINGIFY_HELPER(x) #x
|
#define STRINGIFY_HELPER(x) #x
|
||||||
#define STRINGIFY(x) STRINGIFY_HELPER(x)
|
#define STRINGIFY(x) STRINGIFY_HELPER(x)
|
||||||
@@ -115,9 +118,6 @@
|
|||||||
#define INTERRUPT_ENABLE_CHANNEL_A (1 << OCIE1A)
|
#define INTERRUPT_ENABLE_CHANNEL_A (1 << OCIE1A)
|
||||||
#define INTERRUPT_DISABLE_CHANNEL_A (0 << OCIE1A)
|
#define INTERRUPT_DISABLE_CHANNEL_A (0 << OCIE1A)
|
||||||
|
|
||||||
// text
|
|
||||||
#define SWITCH_CASE(ch) (((ch) >= 'A' && (ch) <= 'Z') || ((ch) >= 'a' && (ch) <= 'z') ? ((ch) ^ (1 << 5)) : (ch))
|
|
||||||
|
|
||||||
// END MACROS
|
// END MACROS
|
||||||
|
|
||||||
void uart_init() {
|
void uart_init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user