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.
Dependencies: fll mbed-rtos mbed
Diff: fll.h
- Revision:
- 33:cc84b10e6c67
- Parent:
- 26:08387521c994
- Parent:
- 32:fdf9f6fca8a2
- Child:
- 34:422d4d6ae5ea
diff -r 2cf0bd32f320 -r cc84b10e6c67 fll.h
--- a/fll.h Tue Feb 17 02:29:57 2015 +0000
+++ b/fll.h Tue Feb 17 03:22:36 2015 +0000
@@ -7,27 +7,27 @@
#include "rtos.h"
#include <stdint.h>
-// buttons represented by 16 bit
-#define R1 0x0001
-#define TRIANGLE 0x0002
-#define CIRCLE 0x0004
-#define CROSS 0x0008
-#define SQUARE 0x0010
-#define R2 0x0020
-#define START 0x0040
-#define ANALOG 0x0080
-#define SELECT 0x0100
-#define L2 0x0200
-#define UP 0x0400
-#define DOWN 0x0800
-#define LEFT 0x1000
-#define RIGHT 0x2000
-#define L1 0x4000
-
#define MAIL_BOX_SIZE 16
#define FRAME (1.0 / 60) // 1 frame (sec)
+#define R1 0x0001
+#define TRIANGLE 0x0002
+#define CIRCLE 0x0004
+#define CROSS 0x0008
+#define SQUARE 0x0010
+#define R2 0x0020
+#define START 0x0040
+#define ANALOG 0x0080
+#define SELECT 0x0100
+#define L2 0x0200
+#define UP 0x0400
+#define DOWN 0x0800
+#define LEFT 0x1000
+#define RIGHT 0x2000
+#define L1 0x4000
+#define BUTTON_NUM 15
+
typedef uint16_t button_t;
// Base object for stream network
@@ -54,22 +54,27 @@
void reset(Producer* src); // reset with new source
};
+class FLL
+{
+public:
+ FLL(Producer* p);
+ ~FLL();
+ void press(button_t btn);
+ void run();
+private:
+ Producer *producer;
+ DigitalOut **pin;
+ int **off;
+};
+
// Output reads the next button from mail box and press the button
// It must be run per 1/60 sec
class Output
{
private:
rtos::Mail<button_t, MAIL_BOX_SIZE>* mail_box;
+ FLL *fll;
public:
- Output(rtos::Mail<button_t, MAIL_BOX_SIZE>* box);
+ Output(rtos::Mail<button_t, MAIL_BOX_SIZE>* box, FLL *f);
void run();
-};
-
-// tells dualshock2 circuit which button is pressed
-void press(button_t btn);
-
-// init function
-void fll_init();
-
-// main function
-void fll_run(Producer* producer);
\ No newline at end of file
+};
\ No newline at end of file
