Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FLL

Shohei Yasutake
February 20, 2015
1.4k

 FLL

Shohei Yasutake

February 20, 2015
Tweet

Transcript

  1. w 4PVSDFετϦʔϜͷ࢝఺ w ্ྲྀ͸ͳ͘ɺԼྲྀʹྲྀ͚ͩ͢ w 'MPXετϦʔϜͷม׵ w ্ྲྀ͔ΒྲྀΕ͖ͯͨϘλϯೖྗʹରͯ͠ Կ͔ม׵ͯ͠Լྲྀʹྲྀ͢ w

    4JOLετϦʔϜͷऴ୺ w ্ྲྀ͔Β࣍ͷϘλϯΛҾͬுͬͯ͘Δ 1VMMܕετϦʔϜ ϘλϯೖྗετϦʔϜ
  2. 1SPEVDFS w 4PVSDFͱ'MPXͷ਌Ϋϥε +BWBͩͱΠϯλʔ ϑΣʔε  w ஋ΛྲྀͤΔ΋ͷ 4JOLҎ֎ ͸͢΂ͯ͜ͷΫϥεͷ

    αϒΫϥε w ͜ͷΫϥεͷαϒΫϥεͰ͋Ε͹ͳΜͰ΋ετϦʔ Ϝͷ෦඼ͱͯ͠࢖͑Δ
  3. 4PVSDF'MPXͷྫ w 0OFUJNF4PVSDF w ϑϨʔϜ͝ͱʹͲͷϘλϯ͕ԡ͞Ε ͍ͯΔ͔ɺͷ഑ྻΛड͚औͬͯҰ౓ͩ ͚Լྲྀʹྲྀ͢ w 3FQFBUFS4PVSDF w

    0OFUJNF4PVSDFͷແݶʹ܁Γฦ͢൛ w &BTZ4PVSDF w ਓؒʹͱͬͯΘ͔Γ΍͍͢ܗͰॻ͚Δ ͦͷ୅ΘΓϑϨʔϜϨϕϧͰਖ਼֬ͳ ೖྗ͸Ͱ͖ͳ͍ w .FSHF'MPX w ෳ਺ͷετϦʔϜ͔ΒΛϘλϯΛड͚औͬͯɺ ͦΕΒΛಉ࣌ԡ͢͠Δ w 4FRVFOUJBM'MPX w ෳ਺ͷετϦʔϜΛॱʑʹྲྀ͢ w %FMBZ'MPX w ্ྲྀ͔ΒྲྀΕͯ͘ΔϘλϯೖྗΛ/ඵ஗Ԇ ͤ͞Δ w 3FQFBUFS'MPX w ্ྲྀ͔ΒྲྀΕͯ͘ΔϘλϯೖྗΛແݶʹ܁Γ ฦ͢ ྲྀΕऴΘͬͨΒ࠷ॳ͔Β࠶ੜ શ෦1SPEVDFSͷαϒΫϥεʹͳ͍ͬͯΔ
  4. ͲͷϘλϯ͕ԡ͞Ε͍ͯΔ͔Λ఻͑Δ෦෼ w 4JOL͸্ྲྀ͔ΒϘλϯ৘ใΛͭड͚औͬͯrtos::Mail ܦ༝Ͱ Output ʹ౉ ͍ͯ͘͠ w όοΫάϥ΢ϯυͰXIJMFMPPQͯ͠Δ w

    0VUQVU͸ϝʔϧΛ։͚ͯίϯτϩʔϥʔʹͲͷϘλϯ͕ԡ͞Ε͍ͯΔ͔Λ఻͑Δ w TFD͝ͱʹਖ਼֬ʹ࣮ߦ͞ΕΔඞཁ͕͋Δ w 4JOLͱ0VUQVU͕෼͔Ε͍ͯΔͷ͸ɺ্ྲྀ͔ΒϘλϯೖྗΛಘΔͷʹ͕͔࣌ؒ ͔ΔՄೳੑ͕͋ΔͨΊɻ0VUQVU͸ϝʔϧΛ։͘ॲཧ͚ͩʹͯ͠λΠϛϯά͕ ·͹ΒʹͳΒͳ͍Α͏ʹ͢Δɻ rtos::Thread rtos::Mail mbed::Ticker
  5. #include "mbed.h" #include "rtos.h" #include "fll.h" #include "fllaux.h" #include "taiko.h"

    #define SIZEOF(arr) (sizeof(arr) / sizeof(arr[0])) int main(void) { note don1 = { Don, 1 }; note don05 = { Don, 0.5 }; ... note kadai1 = { KaDai, 1 }; button_t go_bs[] = { CIRCLE, CIRCLE }; Producer* go = new OnetimeSource(go_bs, SIZEOF(go_bs)); note* note_seq[] = { &un1, &un1, &un1, &un1, ..., &dondai05, &dondai05 }; Producer* taiko = new TaikoSource(note_seq, SIZEOF(note_seq), 200); Producer* delayed_taiko = new DelayFlow(taiko, 9.068); button_time menu_bs[] = { space(40), single(CIRCLE), space(3), single(CIRCLE), space(4) }; Producer* back = new EasySource(menu_bs, SIZEOF(menu_bs)); Producer* src_seq[] = { go, delayed_taiko, back }; Producer* oneset = new SequentialFlow(src_seq, SIZEOF(src_seq)); Producer* source = new RepeaterFlow(oneset); FLL fll(source); fll.run(); } 4PVSDFΛ࡞Δ 4PVSDFΛ૊Έ߹ΘͤΔ ࣮ߦ