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:
- 1:1abcd83947bf
- Parent:
- 0:c80e972b4c59
- Child:
- 2:165723d41023
diff -r c80e972b4c59 -r 1abcd83947bf fll.h
--- a/fll.h Fri Feb 13 13:19:29 2015 +0000
+++ b/fll.h Fri Feb 13 14:41:00 2015 +0000
@@ -22,7 +22,7 @@
#define B_RIGHT 0x2000
#define B_L1 0x4000
-#define QUEUE_SIZE 5
+#define QUEUE_SIZE 16
typedef uint16_t button;
@@ -30,10 +30,11 @@
{
private:
int i;
- vector<button>* button_seq;
+ button* button_seq;
+ int size;
bool loop;
public:
- Source(vector<button>* bs, bool l);
+ Source(button *bs, int s, bool l);
virtual button await();
};
@@ -47,26 +48,11 @@
virtual button await();
};
-// Sink で使う。次に持ち越すキーのクラス。Option[Key] みたいな感じ
-class Carry
-{
-private:
- button btn;
- static const button none = 0x8000; // 1000 0000 0000 0000
-public:
- Carry();
- bool is_empty();
- button get();
- void set(button b);
- void empty();
-};
-
// ストリームの終端になっていて、キー入力をするスレッドに向けてキーを送る
class Sink
{
private:
Source* source;
- Carry* carry;
rtos::Mail<button, QUEUE_SIZE>* queue;
Mutex* queueMutex; // Main Thread と同じ Mutex でなければいけない
public:
