From 3f78e1bbf526cc81170efc689461c38aa0691efd Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Tue, 5 Mar 2024 03:31:58 +0000 Subject: [PATCH 1/5] Buton name updates --- Session2/Lab_Starting_Point/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Session2/Lab_Starting_Point/src/main.cpp b/Session2/Lab_Starting_Point/src/main.cpp index 605073c..5be4603 100644 --- a/Session2/Lab_Starting_Point/src/main.cpp +++ b/Session2/Lab_Starting_Point/src/main.cpp @@ -7,7 +7,9 @@ int main() { DigitalOut ledOne(LED1); //Setup the User Buton as an Input - DigitalIn theButton(USER_BUTTON); + //DigitalIn theButton(USER_BUTTON); + // Its possible this has been remapped to BUTTON1 + DigitalIn theButton(BUTTON1); // Variable to hold button State int buttonState; From 5c68235855342bb9b81b2cda42aebcf005418373 Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Tue, 5 Mar 2024 04:07:00 +0000 Subject: [PATCH 2/5] Lab2 Fix --- Session2/Lab2_Lecture_End/platformio.ini | 8 ++++---- Session2/Lab2_Lecture_End/src/main.cpp | 4 ++-- Session2/Lab_Starting_Point/platformio.ini | 13 +++++++------ .../EventQueue}/.gitignore | 0 .../EventQueue}/.vscode/extensions.json | 0 .../EventQueue}/include/README | 0 .../EventQueue}/lib/README | 0 .../EventQueue}/mbed_app.json | 0 .../EventQueue}/platformio.ini | 0 .../EventQueue}/src/main.cpp | 0 .../EventQueue}/test/README | 0 .../External_LED}/.gitignore | 0 .../External_LED}/.vscode/extensions.json | 0 .../External_LED}/include/README | 0 .../External_LED}/lib/README | 0 .../External_LED}/platformio.ini | 0 .../External_LED}/src/main.cpp | 0 .../External_LED}/test/README | 0 18 files changed, 13 insertions(+), 12 deletions(-) rename {Future/Session3_EventQueues => Session3/EventQueue}/.gitignore (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/.vscode/extensions.json (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/include/README (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/lib/README (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/mbed_app.json (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/platformio.ini (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/src/main.cpp (100%) rename {Future/Session3_EventQueues => Session3/EventQueue}/test/README (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/.gitignore (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/.vscode/extensions.json (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/include/README (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/lib/README (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/platformio.ini (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/src/main.cpp (100%) rename {Future/Session3_ExternalLED => Session3/External_LED}/test/README (100%) diff --git a/Session2/Lab2_Lecture_End/platformio.ini b/Session2/Lab2_Lecture_End/platformio.ini index 207fd96..71ca851 100644 --- a/Session2/Lab2_Lecture_End/platformio.ini +++ b/Session2/Lab2_Lecture_End/platformio.ini @@ -13,8 +13,8 @@ platform = ststm32 board = nucleo_f401re framework = mbed -[env:nucleo_f746zg] -platform = ststm32 -board = nucleo_f746zg -framework = mbed +;[env:nucleo_f746zg] +;platform = ststm32 +;board = nucleo_f746zg +;framework = mbed diff --git a/Session2/Lab2_Lecture_End/src/main.cpp b/Session2/Lab2_Lecture_End/src/main.cpp index 332b4cd..5fa116f 100644 --- a/Session2/Lab2_Lecture_End/src/main.cpp +++ b/Session2/Lab2_Lecture_End/src/main.cpp @@ -5,7 +5,6 @@ int buttonState; // Hander Function for our Buton Press void handler(){ - printf("Update Button State\n"); buttonState = !buttonState; } @@ -16,7 +15,8 @@ int main() { DigitalOut ledOne(LED1); //Setup the User Buton as an Input - InterruptIn theButton(USER_BUTTON); + //InterruptIn theButton(USER_BUTTON); + InterruptIn theButton(BUTTON1); //Bind the interupt to a function theButton.rise(&handler); diff --git a/Session2/Lab_Starting_Point/platformio.ini b/Session2/Lab_Starting_Point/platformio.ini index ce8268e..71ca851 100644 --- a/Session2/Lab_Starting_Point/platformio.ini +++ b/Session2/Lab_Starting_Point/platformio.ini @@ -8,12 +8,13 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:nucleo_f746zg] -platform = ststm32 -board = nucleo_f746zg -framework = mbed - [env:nucleo_f401re] platform = ststm32 board = nucleo_f401re -framework = mbed \ No newline at end of file +framework = mbed + +;[env:nucleo_f746zg] +;platform = ststm32 +;board = nucleo_f746zg +;framework = mbed + diff --git a/Future/Session3_EventQueues/.gitignore b/Session3/EventQueue/.gitignore similarity index 100% rename from Future/Session3_EventQueues/.gitignore rename to Session3/EventQueue/.gitignore diff --git a/Future/Session3_EventQueues/.vscode/extensions.json b/Session3/EventQueue/.vscode/extensions.json similarity index 100% rename from Future/Session3_EventQueues/.vscode/extensions.json rename to Session3/EventQueue/.vscode/extensions.json diff --git a/Future/Session3_EventQueues/include/README b/Session3/EventQueue/include/README similarity index 100% rename from Future/Session3_EventQueues/include/README rename to Session3/EventQueue/include/README diff --git a/Future/Session3_EventQueues/lib/README b/Session3/EventQueue/lib/README similarity index 100% rename from Future/Session3_EventQueues/lib/README rename to Session3/EventQueue/lib/README diff --git a/Future/Session3_EventQueues/mbed_app.json b/Session3/EventQueue/mbed_app.json similarity index 100% rename from Future/Session3_EventQueues/mbed_app.json rename to Session3/EventQueue/mbed_app.json diff --git a/Future/Session3_EventQueues/platformio.ini b/Session3/EventQueue/platformio.ini similarity index 100% rename from Future/Session3_EventQueues/platformio.ini rename to Session3/EventQueue/platformio.ini diff --git a/Future/Session3_EventQueues/src/main.cpp b/Session3/EventQueue/src/main.cpp similarity index 100% rename from Future/Session3_EventQueues/src/main.cpp rename to Session3/EventQueue/src/main.cpp diff --git a/Future/Session3_EventQueues/test/README b/Session3/EventQueue/test/README similarity index 100% rename from Future/Session3_EventQueues/test/README rename to Session3/EventQueue/test/README diff --git a/Future/Session3_ExternalLED/.gitignore b/Session3/External_LED/.gitignore similarity index 100% rename from Future/Session3_ExternalLED/.gitignore rename to Session3/External_LED/.gitignore diff --git a/Future/Session3_ExternalLED/.vscode/extensions.json b/Session3/External_LED/.vscode/extensions.json similarity index 100% rename from Future/Session3_ExternalLED/.vscode/extensions.json rename to Session3/External_LED/.vscode/extensions.json diff --git a/Future/Session3_ExternalLED/include/README b/Session3/External_LED/include/README similarity index 100% rename from Future/Session3_ExternalLED/include/README rename to Session3/External_LED/include/README diff --git a/Future/Session3_ExternalLED/lib/README b/Session3/External_LED/lib/README similarity index 100% rename from Future/Session3_ExternalLED/lib/README rename to Session3/External_LED/lib/README diff --git a/Future/Session3_ExternalLED/platformio.ini b/Session3/External_LED/platformio.ini similarity index 100% rename from Future/Session3_ExternalLED/platformio.ini rename to Session3/External_LED/platformio.ini diff --git a/Future/Session3_ExternalLED/src/main.cpp b/Session3/External_LED/src/main.cpp similarity index 100% rename from Future/Session3_ExternalLED/src/main.cpp rename to Session3/External_LED/src/main.cpp diff --git a/Future/Session3_ExternalLED/test/README b/Session3/External_LED/test/README similarity index 100% rename from Future/Session3_ExternalLED/test/README rename to Session3/External_LED/test/README From 06d8333e5821bd9c57917c07edf672fee6f06530 Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Tue, 5 Mar 2024 05:03:00 +0000 Subject: [PATCH 3/5] Update classess lab so ini points at target board --- Session2/Lab_Classes/platformio.ini | 8 ++++---- Session2/Lab_Classes/src/main.cpp | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Session2/Lab_Classes/platformio.ini b/Session2/Lab_Classes/platformio.ini index 207fd96..71ca851 100644 --- a/Session2/Lab_Classes/platformio.ini +++ b/Session2/Lab_Classes/platformio.ini @@ -13,8 +13,8 @@ platform = ststm32 board = nucleo_f401re framework = mbed -[env:nucleo_f746zg] -platform = ststm32 -board = nucleo_f746zg -framework = mbed +;[env:nucleo_f746zg] +;platform = ststm32 +;board = nucleo_f746zg +;framework = mbed diff --git a/Session2/Lab_Classes/src/main.cpp b/Session2/Lab_Classes/src/main.cpp index 43bf1ee..fcbbd00 100644 --- a/Session2/Lab_Classes/src/main.cpp +++ b/Session2/Lab_Classes/src/main.cpp @@ -39,7 +39,6 @@ int buttonState; // Hander Function for our Buton Press void handler(){ - printf("Update Button State\n"); buttonState = !buttonState; } @@ -49,7 +48,7 @@ int main() { // put your setup code here, to run once: //Setup the User Buton as an Input - InterruptIn theButton(USER_BUTTON); + InterruptIn theButton(BUTTON1); //Bind the interupt to a function theButton.rise(&handler); From e88b206f402b174288e7c470bf9066f68d722d84 Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Tue, 5 Mar 2024 05:03:26 +0000 Subject: [PATCH 4/5] Added a Classess Solution with header file etc --- Session2/Solution_Classes/.gitignore | 5 ++ Session2/Solution_Classes/.mbedignore | 83 +++++++++++++++++++ .../Solution_Classes/.vscode/extensions.json | 10 +++ Session2/Solution_Classes/include/README | 39 +++++++++ Session2/Solution_Classes/lib/README | 46 ++++++++++ Session2/Solution_Classes/platformio.ini | 20 +++++ Session2/Solution_Classes/src/flasher.cpp | 38 +++++++++ Session2/Solution_Classes/src/flasher.h | 40 +++++++++ Session2/Solution_Classes/src/main.cpp | 40 +++++++++ Session2/Solution_Classes/test/README | 11 +++ 10 files changed, 332 insertions(+) create mode 100644 Session2/Solution_Classes/.gitignore create mode 100644 Session2/Solution_Classes/.mbedignore create mode 100644 Session2/Solution_Classes/.vscode/extensions.json create mode 100644 Session2/Solution_Classes/include/README create mode 100644 Session2/Solution_Classes/lib/README create mode 100644 Session2/Solution_Classes/platformio.ini create mode 100644 Session2/Solution_Classes/src/flasher.cpp create mode 100644 Session2/Solution_Classes/src/flasher.h create mode 100644 Session2/Solution_Classes/src/main.cpp create mode 100644 Session2/Solution_Classes/test/README diff --git a/Session2/Solution_Classes/.gitignore b/Session2/Solution_Classes/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/Session2/Solution_Classes/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/Session2/Solution_Classes/.mbedignore b/Session2/Solution_Classes/.mbedignore new file mode 100644 index 0000000..fe58d10 --- /dev/null +++ b/Session2/Solution_Classes/.mbedignore @@ -0,0 +1,83 @@ +/* Bootloader */ +mbed-os/features/FEATURE_BOOTLOADER/* + +/* BLE */ +mbed-os/connectivity/drivers/ble/* +mbed-os/connectivity/FEATURE_BLE/* + +/* Cellular */ +mbed-os/connectivity/cellular/* +mbed-os/connectivity/drivers/cellular/* +mbed-os/connectivity/netsocket/source/Cellular*.* + +/* Device Key */ +mbed-os/drivers/device_key/* + +/* Experimental */ +mbed-os/platform/FEATURE_EXPERIMENTAL_API/* + +/* FPGA */ +mbed-os/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/* + +/* Greentea client */ +mbed-os/features/frameworks/greentea-client/* + +/* LORAWAN */ +mbed-os/connectivity/drivers/lora/* +mbed-os/connectivity/lorawan/* + +/* LWIP */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/lwipstack/* + +/* Mbed-client-cli */ +mbed-os/features/frameworks/mbed-client-cli/* + +/* MBED TLS */ +mbed-os/connectivity/drivers/mbedtls/* +mbed-os/connectivity/mbedtls/* + +/* Nanostack */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/libraries/mbed-coap/* +mbed-os/connectivity/libraries/nanostack-libservice/* +mbed-os/connectivity/libraries/ppp/* +mbed-os/connectivity/nanostack/* + +/* Netsocket */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/netsocket/* +mbed-os/connectivity/libraries/mbed-coap/* +mbed-os/connectivity/libraries/ppp/* + +/* NFC */ +mbed-os/connectivity/drivers/nfc/* +mbed-os/connectivity/nfc/* + +/* RF */ +/*mbed-os/connectivity/drivers/802.15.4_RF/* */ + +/* Storage */ +mbed-os/storage/filesystem/* +mbed-os/storage/kvstore/* +mbed-os/storage/platform/* + +/* Tests */ +mbed-os/platform/tests/* +mbed-os/TEST_APPS/* +mbed-os/TESTS/* +mbed-os/UNITTESTS/* + +/* Unity */ +mbed-os/features/frameworks/unity/* + +/* Utest */ +mbed-os/features/frameworks/utest/* + +/* USB */ +mbed-os/drivers/usb/source/* +mbed-os/hal/usb/source/* +mbed-os/hal/usb/TARGET_Templates/* + +/* WiFi */ +mbed-os/connectivity/drivers/wifi/* \ No newline at end of file diff --git a/Session2/Solution_Classes/.vscode/extensions.json b/Session2/Solution_Classes/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/Session2/Solution_Classes/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/Session2/Solution_Classes/include/README b/Session2/Solution_Classes/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/Session2/Solution_Classes/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/Session2/Solution_Classes/lib/README b/Session2/Solution_Classes/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/Session2/Solution_Classes/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/Session2/Solution_Classes/platformio.ini b/Session2/Solution_Classes/platformio.ini new file mode 100644 index 0000000..71ca851 --- /dev/null +++ b/Session2/Solution_Classes/platformio.ini @@ -0,0 +1,20 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:nucleo_f401re] +platform = ststm32 +board = nucleo_f401re +framework = mbed + +;[env:nucleo_f746zg] +;platform = ststm32 +;board = nucleo_f746zg +;framework = mbed + diff --git a/Session2/Solution_Classes/src/flasher.cpp b/Session2/Solution_Classes/src/flasher.cpp new file mode 100644 index 0000000..c9fa305 --- /dev/null +++ b/Session2/Solution_Classes/src/flasher.cpp @@ -0,0 +1,38 @@ +/* cpp file to go with the header. + +In here we define all the program logic, +matching the function signatures in the header file. + +NOTE: We just include functionality here. +Class variables etc come from the header file. +*/ + +#include "flasher.h" +#include "mbed.h" + + +// Define our constructor +Flasher::Flasher(PinName thePin, int startState) : theLed(thePin){ + state = startState; + } + +// Define Flash Functionality. +void Flasher::flash(){ + if (state == 0){ + theLed = 1; + thread_sleep_for(1000); + theLed = 0; + thread_sleep_for(1000); + } + else { + theLed = 1; + thread_sleep_for(5000); + theLed = 0; + thread_sleep_for(5000); + } + } + +void Flasher::set_state(int the_state){ + state = the_state; + } + \ No newline at end of file diff --git a/Session2/Solution_Classes/src/flasher.h b/Session2/Solution_Classes/src/flasher.h new file mode 100644 index 0000000..29fbc80 --- /dev/null +++ b/Session2/Solution_Classes/src/flasher.h @@ -0,0 +1,40 @@ +/* +This is the headerfile for our class. + +It contains details of the class and all its methods. +This includes definitions, and the function signatures. + +It is used by the compiler to link code from class files, into our main program. + +*/ + +// Avoid the compiler including code every time it is imported +#ifndef FLASHER_H +#define FLASHER_H + +// We Will need mbed for definitions of DigitalOut etc. +#include + +// Here we define the class structure, and variables +class Flasher{ + // Variables + private: + DigitalOut theLed; + int state; + + + /* + We then define the method sigantures here. + + NOTE: We just define the signatures, the code code in the corrisponding .c file + */ + public: + // Constructor. NOTE: We dont include the definition list here + Flasher(PinName thePin, int startState); + + // Public Methods + void flash(); //Our standard Flash + void set_state(int the_state); //Setter method for the state +}; + +#endif \ No newline at end of file diff --git a/Session2/Solution_Classes/src/main.cpp b/Session2/Solution_Classes/src/main.cpp new file mode 100644 index 0000000..4ffd531 --- /dev/null +++ b/Session2/Solution_Classes/src/main.cpp @@ -0,0 +1,40 @@ +#include +#include + + +// Global Flasher Object +Flasher theFlasher(LED2, 0); + +// Variable to hold button State, this needs to be globally avaialable +int buttonState; + +// Hander Function for our Buton Press +void handler(){ + buttonState = !buttonState; + theFlasher.set_state(buttonState); + } + +int main() { + + // put your setup code here, to run once: + + //Setup the User Buton as an Input + InterruptIn theButton(BUTTON1); + + //Bind the interupt to a function + theButton.rise(&handler); + + + + + while(1) { + // put your main code here, to run repeatedly: + + //Print the State of our button + printf("Button State is %d\n", buttonState); + + theFlasher.flash(); + + + } +} diff --git a/Session2/Solution_Classes/test/README b/Session2/Solution_Classes/test/README new file mode 100644 index 0000000..9b1e87b --- /dev/null +++ b/Session2/Solution_Classes/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html From e1a1cdea391b6c3a3927337a226a3ada0b7e6ed8 Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Tue, 5 Mar 2024 06:11:37 +0000 Subject: [PATCH 5/5] Session 3 labs checked --- Session3/EventQueue/.mbedignore | 83 ++++++++++++++++++++++++++++ Session3/EventQueue/platformio.ini | 6 ++ Session3/EventQueue/src/main.cpp | 9 +-- Session3/External_LED/.mbedignore | 83 ++++++++++++++++++++++++++++ Session3/External_LED/platformio.ini | 5 ++ Session3/External_LED/src/main.cpp | 2 +- 6 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 Session3/EventQueue/.mbedignore create mode 100644 Session3/External_LED/.mbedignore diff --git a/Session3/EventQueue/.mbedignore b/Session3/EventQueue/.mbedignore new file mode 100644 index 0000000..fe58d10 --- /dev/null +++ b/Session3/EventQueue/.mbedignore @@ -0,0 +1,83 @@ +/* Bootloader */ +mbed-os/features/FEATURE_BOOTLOADER/* + +/* BLE */ +mbed-os/connectivity/drivers/ble/* +mbed-os/connectivity/FEATURE_BLE/* + +/* Cellular */ +mbed-os/connectivity/cellular/* +mbed-os/connectivity/drivers/cellular/* +mbed-os/connectivity/netsocket/source/Cellular*.* + +/* Device Key */ +mbed-os/drivers/device_key/* + +/* Experimental */ +mbed-os/platform/FEATURE_EXPERIMENTAL_API/* + +/* FPGA */ +mbed-os/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/* + +/* Greentea client */ +mbed-os/features/frameworks/greentea-client/* + +/* LORAWAN */ +mbed-os/connectivity/drivers/lora/* +mbed-os/connectivity/lorawan/* + +/* LWIP */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/lwipstack/* + +/* Mbed-client-cli */ +mbed-os/features/frameworks/mbed-client-cli/* + +/* MBED TLS */ +mbed-os/connectivity/drivers/mbedtls/* +mbed-os/connectivity/mbedtls/* + +/* Nanostack */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/libraries/mbed-coap/* +mbed-os/connectivity/libraries/nanostack-libservice/* +mbed-os/connectivity/libraries/ppp/* +mbed-os/connectivity/nanostack/* + +/* Netsocket */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/netsocket/* +mbed-os/connectivity/libraries/mbed-coap/* +mbed-os/connectivity/libraries/ppp/* + +/* NFC */ +mbed-os/connectivity/drivers/nfc/* +mbed-os/connectivity/nfc/* + +/* RF */ +/*mbed-os/connectivity/drivers/802.15.4_RF/* */ + +/* Storage */ +mbed-os/storage/filesystem/* +mbed-os/storage/kvstore/* +mbed-os/storage/platform/* + +/* Tests */ +mbed-os/platform/tests/* +mbed-os/TEST_APPS/* +mbed-os/TESTS/* +mbed-os/UNITTESTS/* + +/* Unity */ +mbed-os/features/frameworks/unity/* + +/* Utest */ +mbed-os/features/frameworks/utest/* + +/* USB */ +mbed-os/drivers/usb/source/* +mbed-os/hal/usb/source/* +mbed-os/hal/usb/TARGET_Templates/* + +/* WiFi */ +mbed-os/connectivity/drivers/wifi/* \ No newline at end of file diff --git a/Session3/EventQueue/platformio.ini b/Session3/EventQueue/platformio.ini index 577f2ad..dff851f 100644 --- a/Session3/EventQueue/platformio.ini +++ b/Session3/EventQueue/platformio.ini @@ -13,3 +13,9 @@ platform = ststm32 board = nucleo_f401re framework = mbed ;build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT + +;[env:nucleo_f746zg] +;platform = ststm32 +;board = nucleo_f746zg +;framework = mbed +;;build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT diff --git a/Session3/EventQueue/src/main.cpp b/Session3/EventQueue/src/main.cpp index e826ee4..6304014 100644 --- a/Session3/EventQueue/src/main.cpp +++ b/Session3/EventQueue/src/main.cpp @@ -1,14 +1,14 @@ #include "mbed.h" DigitalOut led1(LED1); -DigitalOut led2(LED2); +DigitalOut led2(LED2); DigitalOut led3(LED3); //Event Queue Version // Create a queue that can hold a maximum of 32 events EventQueue queue(32 * EVENTS_EVENT_SIZE); -InterruptIn button(USER_BUTTON); +InterruptIn button(BUTTON1); int buttonState = 0; void led3Event(void){ @@ -17,10 +17,11 @@ void led3Event(void){ void ledEvent(void){ //queue.call(led3Event); - queue.event(led3Event); + queue.call(printf, "rise_handler in context %p\n", ThisThread::get_id()); + queue.call(led3Event); for (int x=0; x<10; x++){ led2 = !led2; - thread_sleep_for(0.1); + thread_sleep_for(500); } } diff --git a/Session3/External_LED/.mbedignore b/Session3/External_LED/.mbedignore new file mode 100644 index 0000000..fe58d10 --- /dev/null +++ b/Session3/External_LED/.mbedignore @@ -0,0 +1,83 @@ +/* Bootloader */ +mbed-os/features/FEATURE_BOOTLOADER/* + +/* BLE */ +mbed-os/connectivity/drivers/ble/* +mbed-os/connectivity/FEATURE_BLE/* + +/* Cellular */ +mbed-os/connectivity/cellular/* +mbed-os/connectivity/drivers/cellular/* +mbed-os/connectivity/netsocket/source/Cellular*.* + +/* Device Key */ +mbed-os/drivers/device_key/* + +/* Experimental */ +mbed-os/platform/FEATURE_EXPERIMENTAL_API/* + +/* FPGA */ +mbed-os/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/* + +/* Greentea client */ +mbed-os/features/frameworks/greentea-client/* + +/* LORAWAN */ +mbed-os/connectivity/drivers/lora/* +mbed-os/connectivity/lorawan/* + +/* LWIP */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/lwipstack/* + +/* Mbed-client-cli */ +mbed-os/features/frameworks/mbed-client-cli/* + +/* MBED TLS */ +mbed-os/connectivity/drivers/mbedtls/* +mbed-os/connectivity/mbedtls/* + +/* Nanostack */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/libraries/mbed-coap/* +mbed-os/connectivity/libraries/nanostack-libservice/* +mbed-os/connectivity/libraries/ppp/* +mbed-os/connectivity/nanostack/* + +/* Netsocket */ +mbed-os/connectivity/drivers/emac/* +mbed-os/connectivity/netsocket/* +mbed-os/connectivity/libraries/mbed-coap/* +mbed-os/connectivity/libraries/ppp/* + +/* NFC */ +mbed-os/connectivity/drivers/nfc/* +mbed-os/connectivity/nfc/* + +/* RF */ +/*mbed-os/connectivity/drivers/802.15.4_RF/* */ + +/* Storage */ +mbed-os/storage/filesystem/* +mbed-os/storage/kvstore/* +mbed-os/storage/platform/* + +/* Tests */ +mbed-os/platform/tests/* +mbed-os/TEST_APPS/* +mbed-os/TESTS/* +mbed-os/UNITTESTS/* + +/* Unity */ +mbed-os/features/frameworks/unity/* + +/* Utest */ +mbed-os/features/frameworks/utest/* + +/* USB */ +mbed-os/drivers/usb/source/* +mbed-os/hal/usb/source/* +mbed-os/hal/usb/TARGET_Templates/* + +/* WiFi */ +mbed-os/connectivity/drivers/wifi/* \ No newline at end of file diff --git a/Session3/External_LED/platformio.ini b/Session3/External_LED/platformio.ini index 6364985..e8f1c8a 100644 --- a/Session3/External_LED/platformio.ini +++ b/Session3/External_LED/platformio.ini @@ -12,3 +12,8 @@ platform = ststm32 board = nucleo_f401re framework = mbed + +;[env:nucleo_f746zg] +;platform = ststm32 +;board = nucleo_f746zg +;framework = mbed \ No newline at end of file diff --git a/Session3/External_LED/src/main.cpp b/Session3/External_LED/src/main.cpp index 88b067d..04de3ba 100644 --- a/Session3/External_LED/src/main.cpp +++ b/Session3/External_LED/src/main.cpp @@ -8,7 +8,7 @@ int main() { DigitalOut firstLED(LED1); //Setup External LED connected to Digital Pin 6 - DigitalOut secondLED(D7); + DigitalOut secondLED(D6); while(1) {