исправлены ошибки
This commit is contained in:
1 parent
42e9becdb9
commit
6f84c00718
2 files changed
+5
-12
No files matched your search
@@ -13,9 +13,6 @@ TaskHandle_t taskNotificationHandler;
|
||||
|
||||
void setup() {
|
||||
|
||||
// Configure pin 2 as an input and enable the internal pull-up resistor.
|
||||
pinMode(2, INPUT_PULLUP);
|
||||
|
||||
// Create task for FreeRTOS notification
|
||||
xTaskCreate(TaskNotification, // Task function
|
||||
"Notification", // Task name
|
||||
@@ -36,11 +33,11 @@ void TaskNotification(void *pvParameters)
|
||||
{
|
||||
(void) pvParameters;
|
||||
|
||||
int digitalPin = 2;
|
||||
int digitalPin = BTN_BUILTIN;
|
||||
|
||||
Serial.begin(9600);
|
||||
|
||||
attachInterrupt(digitalPinToInterrupt(digitalPin), digitalPinInterruptHandler, LOW);
|
||||
attachInterrupt(digitalPinToInterrupt(digitalPin), digitalPinInterruptHandler, RISING);
|
||||
|
||||
for (;;) {
|
||||
|
||||
@@ -55,7 +52,6 @@ void TaskNotification(void *pvParameters)
|
||||
void digitalPinInterruptHandler() {
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
vTaskNotifyGiveFromISR(taskNotificationHandler, &xHigherPriorityTaskWoken);
|
||||
if (xHigherPriorityTaskWoken) {
|
||||
taskYIELD();
|
||||
}
|
||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user