-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathModulino.cpp
32 lines (28 loc) · 946 Bytes
/
Modulino.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2024 Arduino SA
// SPDX-License-Identifier: MPL-2.0
#include "Modulino.h"
// The only singleton that needs to exist
// Build before other objects to fix the Wire object
ModulinoClass Modulino __attribute__ ((init_priority (101)));
ModulinoColor BLACK(0, 0, 0);
ModulinoColor RED(255, 0, 0);
ModulinoColor BLUE(0, 0, 255);
ModulinoColor GREEN(0, 255, 0);
ModulinoColor YELLOW(255, 255, 0);
ModulinoColor VIOLET(255, 0, 255);
ModulinoColor CYAN(0, 255, 255);
ModulinoColor WHITE(255, 255, 255);
#if __has_include("Arduino_LED_Matrix.h")
void __increaseI2CPriority() {
for (int i = 0; i < 96; i++) {
if (R_ICU->IELSR[i] == BSP_PRV_IELS_ENUM(EVENT_IIC0_TXI)) {
NVIC_SetPriority(IRQn_Type(i), 6);
NVIC_SetPriority(IRQn_Type(i+1), 6);
NVIC_SetPriority(IRQn_Type(i+2), 6);
NVIC_SetPriority(IRQn_Type(i+3), 6);
}
}
}
#else
void __increaseI2CPriority() {}
#endif