Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: RTOS-Threads/src/Task4.cpp
- Revision:
- 50:8a0accb23007
- Parent:
- 44:4be5c01c6de2
- Child:
- 51:04c6af4319e1
--- a/RTOS-Threads/src/Task4.cpp Mon May 19 13:33:34 2014 +0000
+++ b/RTOS-Threads/src/Task4.cpp Mon May 19 14:16:47 2014 +0000
@@ -6,11 +6,13 @@
* 200Hz <= PWM frequency <= 400Hz
* Frequency: 400Hz
* Refer to tasks.h to change PWM frequency
- * Timing:
+ * Timing:
*/
#include "tasks.h"
#include "setup.h"
+Semaphore sem_Task4(1);
+
volatile int ESCpower[4] = {0, 0, 0, 0};
int stallESC = 0;
@@ -24,10 +26,8 @@
// ==================
// === ESC UPDATE ===
// ==================
-//Timer
void Task4(void const *argurment)
{
-//Timer
if (armed) {
if (calibration_mode) {
for (int i = 0; i < 4; i++)
@@ -73,7 +73,6 @@
ESC[i].pulsewidth_us(ESCpower[i]);
}
}
-//Timer
}
@@ -82,6 +81,11 @@
// ************************
// *** Helper functions ***
// ************************
+void Task4_ISR(void const *argument)
+{
+ //sem_Task4.release();
+}
+
int constrainESC(float input)
{
if (input < 1100.0)