-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bonus: Added example project for ISRTaskEventQueue. Closes #5
- Loading branch information
1 parent
da2ac2d
commit 64cbf76
Showing
13 changed files
with
70 additions
and
218 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include(${CMAKE_CURRENT_LIST_DIR}/../common_project.cmake) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Created by permal on 2018-10-21. | ||
// | ||
|
||
#include "interrupt_queue.h" | ||
#include <smooth/core/Task.h> | ||
#include <smooth/core/task_priorities.h> | ||
|
||
using namespace smooth::core; | ||
|
||
namespace interrupt_queue | ||
{ | ||
App::App() | ||
: Application(smooth::core::APPLICATION_BASE_PRIO, std::chrono::seconds(1)), | ||
queue(*this, *this), | ||
input(queue, GPIO_NUM_21, true, false, GPIO_INTR_ANYEDGE) | ||
{ | ||
} | ||
|
||
void App::init() | ||
{ | ||
std::cout << "Trigger the input!" << std::endl; | ||
} | ||
|
||
void App::event(const smooth::core::io::InterruptInputEvent& value) | ||
{ | ||
std::cout << "Value from interrupt: " << value.get_state() << std::endl; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include <iostream> | ||
#include <smooth/core/Application.h> | ||
#include <smooth/core/task_priorities.h> | ||
#include <smooth/core/io/InterruptInput.h> | ||
#include <smooth/core/ipc/ISRTaskEventQueue.h> | ||
#include <smooth/core/ipc/IEventListener.h> | ||
|
||
namespace interrupt_queue | ||
{ | ||
class App | ||
: public smooth::core::Application, | ||
public smooth::core::ipc::IEventListener<smooth::core::io::InterruptInputEvent> | ||
{ | ||
public: | ||
App(); | ||
|
||
void init() override; | ||
|
||
void event(const smooth::core::io::InterruptInputEvent& value) override; | ||
|
||
protected: | ||
smooth::core::ipc::ISRTaskEventQueue<smooth::core::io::InterruptInputEvent, 5> queue; | ||
smooth::core::io::InterruptInput input; | ||
}; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#include "json_test.h" | ||
|
||
#include <algorithm> | ||
#include <fstream> | ||
#include <cassert> | ||
#include <json/cJSON/cJSON.h> | ||
|