rabbit-slide-hasumikin-rubykaigi2018 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.rabbit +1 -0
  3. data/01.png +0 -0
  4. data/01.svg +6 -0
  5. data/180425_mruby-c_fix_color_data-04.png +0 -0
  6. data/IDE.png +0 -0
  7. data/README.rd +24 -0
  8. data/Rakefile +17 -0
  9. data/RubyKaigi/343/201/250RWC/343/203/241/343/203/242.md +60 -0
  10. data/SWOT.png +0 -0
  11. data/background-487.png +0 -0
  12. data/book.jpg +0 -0
  13. data/chi.png +0 -0
  14. data/config.yaml +20 -0
  15. data/fb_avatar.jpg +0 -0
  16. data/firmware-programming-with-mrubyc.rab +870 -0
  17. data/hasumi-hitoshi_rubykaigi2018.pdf +0 -0
  18. data/hasumi.jpg +0 -0
  19. data/hiroshima.png +0 -0
  20. data/itoc.png +0 -0
  21. data/juji-asahi.jpg +0 -0
  22. data/kamosu.png +0 -0
  23. data/keynote-base2-482.png +0 -0
  24. data/mark.png +0 -0
  25. data/mo.png +0 -0
  26. data/mruby_and_mrubyc.png +0 -0
  27. data/mrubyc-utils.png +0 -0
  28. data/mrubyc.png +0 -0
  29. data/pdf/rubykaigi2018-firmware-programming-with-mrubyc.pdf +0 -0
  30. data/psoc5lp_board.jpg +0 -0
  31. data/psoc5lp_chip.jpg +0 -0
  32. data/raspberrypi.jpg +0 -0
  33. data/rubykaigi2018/Data/keynote-base2-small-483.png +0 -0
  34. data/rubykaigi2018/Data/mt-07EEAA23-F087-48C1-B6D0-04F3123EF6C7-497.jpg +0 -0
  35. data/rubykaigi2018/Data/mt-34132DA9-39FA-4A8F-8746-9B5D61EA2BB2-499.jpg +0 -0
  36. data/rubykaigi2018/Data/mt-6574C108-BEFF-4758-89D5-39BDC991689B-492.jpg +0 -0
  37. data/rubykaigi2018/Data/mt-9743D149-6212-491D-B540-36EC9CCB8771-503.jpg +0 -0
  38. data/rubykaigi2018/Data/mt-9A80FDDF-6232-463E-AD1D-760FAC40A078-495.jpg +0 -0
  39. data/rubykaigi2018/Data/mt-E8BB6D9E-506A-42C8-A335-455FEDC2E11C-485.jpg +0 -0
  40. data/rubykaigi2018/Data/mt-F39BAD95-4ABB-4F39-A54F-1C6A46BCA6C5-501.jpg +0 -0
  41. data/rubykaigi2018/Data/mt-FB34A69A-47CA-4DC0-B1CC-3927EA011B27-490.jpg +0 -0
  42. data/rubykaigi2018/Data//350/234/210/357/275/250/350/217/264/343/203/273-small-488.png +0 -0
  43. data/rubykaigi2018/preview-micro.jpg +0 -0
  44. data/rubykaigi2018/preview-web.jpg +0 -0
  45. data/rubykaigi2018/preview.jpg +0 -0
  46. data/shinjiko.jpg +0 -0
  47. data/tranquilo.jpg +0 -0
  48. data/unsoldered-2.png +0 -0
  49. data/unsoldered.jpg +0 -0
  50. metadata +109 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 220c05d30258ee591f44b2d4616038ade9d22dd46b24011b1d1e4e3718710765
4
+ data.tar.gz: a7a0f49972af66142fc53357b81d8fc03f5d39601494fc32e7a1799db57bd6f5
5
+ SHA512:
6
+ metadata.gz: 29165b0f07519201d34ee3db7c4db7ee24aaf5bfa8311825c9994a7db976c57ba0adb4797ee62cf7cc61b950b2fc13c69e39ad0af5e1fc25fab549cf8b378d62
7
+ data.tar.gz: 5a17d1427fcdba58275d12abf5041042dda9e3ed112bf7d132eaf0452b6896de9eb9a2b8f388b3b3bdf8e5060bb0f8373bd0fc85353cd49180124a91c21a4694
data/.rabbit ADDED
@@ -0,0 +1 @@
1
+ firmware-programming-with-mrubyc.rab
data/01.png ADDED
Binary file
data/01.svg ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg contentScriptType="text/ecmascript" xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify" style="-webkit-print-color-adjust:exact; color-adjust:exact !important;" contentStyleType="text/css" viewBox="8.0 -14.0 842.0 613.0" xmlns:cacoo="http://cacoo.com/" preserveAspectRatio="xMidYMin meet" xmlns="http://www.w3.org/2000/svg" version="1.1"><g><foreignObject height="89px" width="377px" transform="translate(29.0 487.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:373px;height:85px;display:table-cell;vertical-align:top;display:flex;word-wrap:break-word;-webkit-align-items:flex-begin;align-items:flex-begin;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Rockwell;white-space:pre-wrap;font-size:22px;font-weight:normal;line-height:27px;">RTOS manages VMs.
3
+ you should learn about RTOS to use its features like concurrency</span><span style="color:#000000 !important;font-family:Rockwell;white-space:pre-wrap;font-size:24px;font-weight:normal;line-height:29px;">
4
+ </span></div></div></div></foreignObject><g transform="translate(445.0 59.0)"><g transform="translate(0.0 50.0)"><path fill-opacity="1.0" fill="#06cc8a" style="fill-rule: evenodd;" stroke-linejoin="round" d="M368.00001578132515 281.9999933242798 L0.0 281.9999933242798 L0.0 0.0 L368.00001578132515 0.0 L368.00001578132515 281.9999933242798z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="280px" width="366px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:362px;height:276px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><g transform="translate(0.0 144.0)"><path fill-opacity="1.0" fill="#5d7af9" style="fill-rule: evenodd;" stroke-linejoin="round" d="M265.99999595834663 95.00000262012085 L0.0 95.00000262012085 L0.0 0.0 L265.99999595834663 0.0 L265.99999595834663 95.00000262012085z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="93px" width="264px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:260px;height:89px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><foreignObject height="41px" width="76px" transform="translate(68.0 163.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:72px;height:37px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#D0FBFA !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">VM</span></div></div></div></foreignObject><g transform="translate(0.0 237.0)"><path fill-opacity="1.0" fill="#5d7af9" style="fill-rule: evenodd;" stroke-linejoin="round" d="M132.9999926550083 95.00000262012085 L0.0 95.00000262012085 L0.0 0.0 L132.9999926550083 0.0 L132.9999926550083 95.00000262012085z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="93px" width="131px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:127px;height:89px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><foreignObject height="41px" width="76px" transform="translate(30.0 263.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:72px;height:37px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#D0FBFA !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">hal</span></div></div></div></foreignObject><g transform="translate(133.0 237.0)"><path fill-opacity="1.0" fill="#5d7af9" style="fill-rule: evenodd;" stroke-linejoin="round" d="M132.99999295995661 95.00000262012085 L0.0 95.00000262012085 L0.0 0.0 L132.99999295995661 0.0 L132.99999295995661 95.00000262012085z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="93px" width="131px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:127px;height:89px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><foreignObject height="41px" width="109px" transform="translate(148.0 264.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:105px;height:37px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#D0FBFA !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">rrt0</span></div></div></div></foreignObject><foreignObject height="41px" width="76px" transform="translate(176.0 168.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:72px;height:37px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#D0FBFA !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">VM</span></div></div></div></foreignObject><foreignObject height="55px" width="119px" transform="translate(211.0 79.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:115px;height:51px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#A3FFC4 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">job2</span></div></div></div></foreignObject><g transform="translate(0.0 332.0)"><path fill-opacity="1.0" fill="#ffbf00" style="fill-rule: evenodd;" stroke-linejoin="round" d="M368.00000965595245 94.00000050663948 L0.0 94.00000050663948 L0.0 0.0 L368.00000965595245 0.0 L368.00000965595245 94.00000050663948z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="92px" width="366px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:362px;height:88px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><foreignObject height="47px" width="223px" transform="translate(68.0 354.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:219px;height:43px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#FEE1CC !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">hardware</span></div></div></div></foreignObject><foreignObject height="50px" width="362px" transform="translate(3.0 0.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:358px;height:46px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#5D7AF9 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">mruby/c</span></div></div></div></foreignObject><foreignObject height="55px" width="119px" transform="translate(37.0 80.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:115px;height:51px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#A3FFC4 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">job1</span></div></div></div></foreignObject><g transform="translate(159.0 83.0) rotate(328.4462316317571 89.0 62.0)"><path fill="none" d="M178.00000223830938 61.99999863895647 Q178.00000223830938 87.6800087152208 151.93368191053136 105.83957767657621 Q125.86611558273765 123.99999727791294 89.00000111915469 123.99999727791294 Q52.13531065558962 123.99999727791294 26.06765995579487 105.84050519655582 Q0.0 87.68101807519862 0.0 61.99999863895647 Q0.0 36.31897920271431 26.067656395794824 18.159492825357084 Q52.13531065558962 0.0 89.00000111915469 0.0 Q125.86674570274556 0.0 151.93368191053136 18.15949034535714 Q178.00000223830938 36.318552642723674 178.00000223830938 61.99999863895647 L178.00000223830938 61.99999863895647z" stroke-dasharray="9.0 9.0" stroke-width="3.0" stroke-linejoin="round" stroke="#666666"/><foreignObject height="83px" width="128px" transform="translate(24.642320065425746 19.743280664001386)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:124px;height:79px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Arial;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><g transform="translate(15.0 85.0) rotate(259.8186817219498 83.0 58.0)"><path fill="none" d="M166.00000060699904 57.999998845975014 Q166.00000060699904 82.02323412798512 141.6909605181101 99.01121802997551 Q117.38075842921691 115.99999769195003 83.00000030349952 115.99999769195003 Q48.62057017778698 115.99999769195003 24.310289404893506 99.01208570995821 Q0.0 82.02417836796633 0.0 57.999998845975014 Q0.0 33.97581932398371 24.31028608489349 16.987912677991794 Q48.62057017778698 0.0 83.00000030349952 0.0 Q117.38134606921903 0.0 141.6909605181101 16.987910357991836 Q166.00000060699904 33.975420283991646 166.00000060699904 57.999998845975014 L166.00000060699904 57.999998845975014z" stroke-dasharray="9.0 9.0" stroke-width="3.0" stroke-linejoin="round" stroke="#666666"/><foreignObject height="78px" width="120px" transform="translate(22.981039856066637 18.469520659123596)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:116px;height:74px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Arial;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g></g><g transform="translate(23.0 60.0)"><g transform="translate(0.0 50.0)"><path fill-opacity="1.0" fill="#06cc8a" style="fill-rule: evenodd;" stroke-linejoin="round" d="M368.00001578132515 281.9999933242798 L0.0 281.9999933242798 L0.0 0.0 L368.00001578132515 0.0 L368.00001578132515 281.9999933242798z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="280px" width="366px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:362px;height:276px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><g transform="translate(0.0 144.0)"><path fill-opacity="1.0" fill="#06cc8a" style="fill-rule: evenodd;" stroke-linejoin="round" d="M242.00000378030992 95.00000262012085 L0.0 95.00000262012085 L0.0 0.0 L242.00000378030992 0.0 L242.00000378030992 95.00000262012085z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="93px" width="240px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:236px;height:89px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><g transform="translate(0.0 332.0)"><path fill-opacity="1.0" fill="#ffbf00" style="fill-rule: evenodd;" stroke-linejoin="round" d="M368.00000965595245 94.00000050663948 L0.0 94.00000050663948 L0.0 0.0 L368.00000965595245 0.0 L368.00000965595245 94.00000050663948z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="92px" width="366px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:362px;height:88px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><foreignObject height="41px" width="76px" transform="translate(41.0 167.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:72px;height:37px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#A3FFC4 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">VM</span></div></div></div></foreignObject><foreignObject height="47px" width="223px" transform="translate(79.0 352.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:219px;height:43px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#FEE1CC !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">hardware</span></div></div></div></foreignObject><g transform="translate(0.0 238.0)"><path fill-opacity="1.0" fill="#ffbf00" style="fill-rule: evenodd;" stroke-linejoin="round" d="M302.0000064286436 94.00000050663948 L0.0 94.00000050663948 L0.0 0.0 L302.0000064286436 0.0 L302.0000064286436 94.00000050663948z" stroke="#ffffff" stroke-width="10.0"/><foreignObject height="92px" width="300px" transform="translate(1.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:296px;height:88px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:DIN Alternate;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><foreignObject height="47px" width="266px" transform="translate(20.0 261.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:262px;height:43px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#FEE1CC !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">RTOS</span></div></div></div></foreignObject><foreignObject height="41px" width="76px" transform="translate(151.0 167.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:72px;height:37px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#A3FFC4 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">VM</span></div></div></div></foreignObject><foreignObject height="50px" width="362px" transform="translate(3.0 0.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:358px;height:46px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#06CC8A !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">mruby</span></div></div></div></foreignObject><foreignObject height="55px" width="119px" transform="translate(248.0 121.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:115px;height:51px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#A3FFC4 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">job2</span></div></div></div></foreignObject><foreignObject height="55px" width="119px" transform="translate(41.0 70.0)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:115px;height:51px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#A3FFC4 !important;font-family:&quot;Arial Black&quot;;white-space:pre-wrap;font-size:40px;font-weight:normal;line-height:40px;">job1</span></div></div></div></foreignObject><g transform="translate(139.0 117.0) rotate(341.46179357852793 114.0 49.5)"><path fill="none" d="M228.00000602779676 49.500001159218414 Q228.00000602779676 70.00259077935941 194.6116851450862 84.50095697889017 Q161.22176826233343 99.00000231843683 114.00000301389838 99.00000231843683 Q66.78006176551153 99.00000231843683 33.390036810755916 84.50169749890749 Q0.0 70.00339663937827 0.0 49.500001159218414 Q0.0 28.996605679058554 33.3900322507558 14.498305413529337 Q66.78006176551153 0.0 114.00000301389838 0.0 Q161.22257538235476 0.0 194.6116851450862 14.49830343352929 Q228.00000602779676 28.99626511905058 228.00000602779676 49.500001159218414 L228.00000602779676 49.500001159218414z" stroke-dasharray="9.0 9.0" stroke-width="3.0" stroke-linejoin="round" stroke="#666666"/><foreignObject height="67px" width="164px" transform="translate(31.56432052137782 15.762781245301204)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:160px;height:63px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Arial;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g><g transform="translate(-1.0 81.0) rotate(285.99032405435753 87.5 61.5)"><path fill="none" d="M174.99999629588314 61.00799746146697 Q174.99999629588314 86.27712687978253 149.372996838314 104.14614238649565 Q123.7447723807708 122.01599492293394 87.49999814794157 122.01599492293394 Q51.25662391508269 122.01599492293394 25.628316507541246 104.14705506613765 Q0.0 86.2781200899812 0.0 61.00799746146697 Q0.0 35.737874832952734 25.628313007541323 17.868940588892237 Q51.25662391508269 0.0 87.49999814794157 0.0 Q123.74539188075768 0.0 149.372996838314 17.868938148572337 Q174.99999629588314 35.737455097930194 174.99999629588314 61.00799746146697 L174.99999629588314 61.00799746146697z" stroke-dasharray="9.0 9.0" stroke-width="3.0" stroke-linejoin="round" stroke="#666666"/><foreignObject height="82px" width="126px" transform="translate(24.226999246876137 19.427387791483014)"><div style="width:100%;height:100%;text-align:center;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:122px;height:78px;display:table-cell;vertical-align:middle;display:flex;word-wrap:break-word;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Arial;white-space:pre-wrap;font-size:12px;font-weight:normal;line-height:12px;"></span></div></div></div></foreignObject></g></g><foreignObject height="97px" width="393px" transform="translate(442.0 487.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:389px;height:93px;display:table-cell;vertical-align:top;display:flex;word-wrap:break-word;-webkit-align-items:flex-begin;align-items:flex-begin;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Rockwell;white-space:pre-wrap;font-size:22px;font-weight:normal;line-height:27px;">you can run multiple tasks without OS because rrt0 manages VMs.
5
+ hal is hardware abstraction layer</span></div></div></div></foreignObject><foreignObject height="62px" width="735px" transform="translate(35.0 1.0)"><div style="width:100%;height:100%;text-align:left;box-sizing:border-box;padding:2px;line-height:1px;" xmlns="http://www.w3.org/1999/xhtml"><div style="width:731px;height:58px;display:table-cell;vertical-align:top;display:flex;word-wrap:break-word;-webkit-align-items:flex-begin;align-items:flex-begin;-webkit-justify-content:flex-begin;justify-content:flex-begin;"><div style="max-width:100%;"><span style="color:#000000 !important;font-family:Rockwell;white-space:pre-wrap;font-size:22px;font-weight:normal;line-height:27px;">each of tasks is made up of job and VM
6
+ every jobs are compiled with `mrbc` even if you use mruby/c</span></div></div></div></foreignObject></g></svg>
data/IDE.png ADDED
Binary file
data/README.rd ADDED
@@ -0,0 +1,24 @@
1
+ = Firmware programming with mruby/c
2
+
3
+ We have a new choice to write firmware for microcomputers(microcontrollers). It's mruby/c. This talk shows how to introduce mruby/c firmware programming. And besides, my actual IoT project for Japanese Sake brewery will be described. Since mruby/c is still a young growing tool, you will know there are several(many?) things you can help it to become better.
4
+
5
+ == 作者向け
6
+
7
+ === 表示
8
+
9
+ rake
10
+
11
+ === 公開
12
+
13
+ rake publish
14
+
15
+ == 閲覧者向け
16
+
17
+ === インストール
18
+
19
+ gem install rabbit-slide-hasumikin-rubykaigi2018
20
+
21
+ === 表示
22
+
23
+ rabbit rabbit-slide-hasumikin-rubykaigi2018.gem
24
+
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require "rabbit/task/slide"
2
+
3
+ # Edit ./config.yaml to customize meta data
4
+
5
+ spec = nil
6
+ Rabbit::Task::Slide.new do |task|
7
+ spec = task.spec
8
+ # spec.files += Dir.glob("doc/**/*.*")
9
+ # spec.files -= Dir.glob("private/**/*.*")
10
+ # spec.add_runtime_dependency("YOUR THEME")
11
+ end
12
+
13
+ desc "Tag #{spec.version}"
14
+ task :tag do
15
+ sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
16
+ sh("git", "push", "--tags")
17
+ end
@@ -0,0 +1,60 @@
1
+ # RubyKaigi & RWC メモ
2
+
3
+ https://www.slideshare.net/kazuakitanaka391/mrubyc-in-tokyorubykaigi11
4
+
5
+ - ハードウェアの出荷基準とWebアプリのデリバタームのギャップ
6
+ - RubyistこそIoTアーキテクトに最も近い
7
+ - エッジ側でJSONを使う必要性は低いが、JSONが流れていればLambdaのログなどからデバッグしやすい
8
+ - どのロジックをデバイス側に書くか、クラウド側に書くかは当初決めにくい
9
+ - 現場で試行錯誤しないと最適な実装がみつからない
10
+ - とはいえ現場でできることは限られる(作業環境、焦りなど)ので、最初はなるべくクラウド側に実装するのがよい
11
+ - ラズパイ上のCRubyでirbからいろんな実験、検証が楽々可能。そのときのスニペットをmrubyにコピペできる
12
+ - 通信モジュールなど、タイミング問題のある機器に注意が必要
13
+ - 直接3G回線につながるIoTデバイスの場合、Linuxのようなマルウェアの標的になりやすいプラットフォームでない方が管理が楽になる可能性がある
14
+ - 温度データが漏洩しても、それによって十旭日は造れない。しかし温度変化をたどれば空き巣に入れるタイミングが見つかるかもしれない
15
+ - こういうことも含めて設計できるアーキテクトはRubyistである
16
+ - 苦労したこと
17
+ - オブジェクト指向っぽく書こうとしてしまった→こだわるとだめ
18
+ - デバッグ方法がわからなかった→東さんのdebugprint()
19
+ - flagmentの値はいくつだとどうなのか
20
+ - 見知らぬ機器使うときはいきなりマイコンに接続せず、最初にラズパイ+CRuby+
21
+ -
22
+ -
23
+ - リアルタイムOS
24
+ - 普通のRTOSは、CPUの命令コードレベルでマルチタスクを行いますが、mruby/c VMでは mrubyのバイトコードレベルでマルチタスクを行っています
25
+ - センサ値表示を続けながら3G通信
26
+ - 3.times ができない
27
+ - vm_config.h のMAX_GLOBAL_OBJECT_SIZE
28
+ - for i in 0..3 みたいに書くと、内部でeachに展開されるが、eachがないのでエラー `No method. vtype=24 method='each'`
29
+ - mathはいまのところ自動で入るが、コンパイル時にオンオフするように仕様変更予定
30
+ -
31
+
32
+ HAL=hardware abstruct layer. ハードウェアの違いを吸収する。ハードごとにそれぞれつくる必要がある
33
+ vm.cがバイトコードをひとつずつ読んで、サブルーチンに飛ばす。その対応表がopcode.c
34
+ vm_config.hはpullすると上書きされる。避けておいて書き戻せばよいが、このファイル自体の仕様が変わったらアウトなのでdiffとって目検するか自動化するスクリプトを書くか。バッチを書こう
35
+ `t_` をコンパイルして `c_` とか?にするようなコーディングルールを提唱しよう
36
+ UART送信ステータスを見ないとC言語で書いたときと同様には動かないことがある。非同期的に動いている可能性
37
+ rrt0について。スケジューラ管理を一切合切やっている。もとは「crt0」というのがあり、それのRuby版。名前を変えようという話がある。最初はスケジューラ機能だけだったが、メモリの排他処理もここにきた。ふつうの意味のOSの役割をこいつがやっていて、各VMに指令を出している
38
+ mrbc_create_taskが呼ばれると、load.cがコンパイル済みプログラム(リテラルはASCIIで書かれていたりする)をセクションごとになめてメモリ上に配置する。
39
+ mrbc_run()はもっと多くの関数のラッパになっていて複数タスクをスケジューリングする、VMの動きをスケジューラ抜きで観察するためにはこうなっていると都合がいい
40
+ to_jsonはeachができたらつくる!田中先生まち
41
+ mutex_lock -> c_mutex_lock -> mrbc_mutex_lock の順で呼ばれるが、自分でラッパを書くときは直接mrbc_*を叩いてもいいよ
42
+
43
+ # きょう聞きたいこと
44
+ - config値を上書きするベストプラクティス
45
+ -
46
+ -
47
+ -
48
+ -
49
+ -
50
+ -
51
+ -
52
+ -
53
+ -
54
+ -
55
+ -
56
+ -
57
+ -
58
+ -
59
+ -
60
+ -
data/SWOT.png ADDED
Binary file
Binary file
data/book.jpg ADDED
Binary file
data/chi.png ADDED
Binary file
data/config.yaml ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: rubykaigi2018
3
+ base_name: firmware-programming-with-mrubyc
4
+ tags:
5
+ - mrubyc
6
+ presentation_date:
7
+ version: 1.0.0
8
+ licenses: []
9
+ slideshare_id:
10
+ speaker_deck_id:
11
+ ustream_id:
12
+ vimeo_id:
13
+ youtube_id:
14
+ author:
15
+ markup_language: :rd
16
+ name: HASUMI Hitoshi
17
+ email: hasumikin@gmail.com
18
+ rubygems_user: hasumikin
19
+ slideshare_user:
20
+ speaker_deck_user:
data/fb_avatar.jpg ADDED
Binary file
@@ -0,0 +1,870 @@
1
+ = Firmware Programming with mruby/c
2
+
3
+ :author
4
+ HASUMI Hitoshi
5
+ :institution
6
+ Monstar Lab, Matsue office
7
+ :allotted-time
8
+ 40m
9
+ :theme
10
+ ./hasumi_theme
11
+ :date
12
+ 2018/6/1
13
+ :place
14
+ RubyKaigi2018@Sendai International Center
15
+
16
+ = before starting,
17
+ * assumed audience
18
+ * people who want to make IoT with Ruby
19
+ * people who have never touched mruby/c
20
+ * people who did only tutorials of mruby/c
21
+ * ((*people who love Sake*))
22
+ * what this talk doesn't mention
23
+ * microcontroller itself and peripheral concepts like GPIO, UART, ADC, etc.
24
+
25
+ = recommended book about microcontroller
26
+ # image
27
+ # src = book.jpg
28
+ # align = center
29
+ # relative-height = 95
30
+
31
+ = recommended tutorial
32
+ # image
33
+ # src = itoc.png
34
+ # align = center
35
+ # relative-height = 70
36
+ http://www.s-itoc.jp/activity/research/mrubyc/mrubyc_tutorial/
37
+
38
+ = agenda
39
+ * terminology
40
+ * about my IoT project
41
+ * mruby and mruby/c
42
+ * how does mruby/c work
43
+ * debugging
44
+ * actual source code of my project
45
+ * development environment
46
+
47
+ = terminology
48
+
49
+ = terminology
50
+ * mruby/c
51
+ * I say エムルビーシー[emurubi:ʃí:] in this talk
52
+ * microcontroller = マイコン[maikon]
53
+ * small computer contains CPU, memory and programmable I/O peripherals
54
+ * in this talk, microcontroller is distinguished from single board computer like Raspberry Pi.\nRasPi is rich, microcontroller is poor
55
+
56
+ = terminology
57
+ * RTOS
58
+ * Real-time OS. usually used for microcontroller. but we won't use it
59
+ * task
60
+ * almost equivalent to `thread` in linux. we say `task` in microcontroller world
61
+
62
+ = terminology
63
+ * 旭日酒造(asahi-shuzo)
64
+ * one of the best Japanese Sake brewery
65
+ * I also call the brewery ((*asahi-san*))
66
+ * asahi-san and I make IoT system using mruby/c
67
+
68
+ = terminology (IMO)
69
+ * 旭酒造(asahi-shuzo), yamaguchi: 獺祭(dassai). fruity, aromatic and sweet
70
+ * 朝日酒造(asahi-shuzo), niigata: 久保田(kubota). clear, dry and sharp
71
+ * 朝日酒造(asahi-shuzo), fukui: I don't know at all...
72
+ * 旭日酒造(asahi-shuzo), shimane: ((*十旭日(juji-asahi)*)). tasteful, mature with years and good for お燗(warmed style)
73
+
74
+ = why microcontroller?
75
+ (rather than single board computer)
76
+
77
+ = why microcontroller?
78
+ * it starts immediately right after plugged in
79
+ * end users, brewery workers in my case, can use simply
80
+ * you can narrow security issue list
81
+ * many a malware aims at linux or windows platform as a target
82
+ * you don't need to consider unnecessary deamon
83
+ * you don't need to do `apt upgrade`
84
+
85
+ = why microcontroller?
86
+ * low energy
87
+ * rarely overheated
88
+ * many choices of power supply
89
+ * mass production
90
+ * you can choose appropriate chipset(number of GPIOs, memory size, etc.) for your application
91
+ * cost advantage for parts supply and subcontractor manufacturing
92
+
93
+ = which microcontroller?
94
+
95
+ = which microcontroller?
96
+ # image
97
+ # src = psoc5lp_chip.jpg
98
+ # align = center
99
+ # relative-height = 45
100
+ * CYPRESS PSoC5LP
101
+ * 32-bit Arm Cortex-M3 CPU
102
+ * Flash/SRAM: 256KB/64KB
103
+ * package: 68-pin QFN, 99-pin WLCSP, 100-pin TQFP
104
+
105
+ = which microcontroller?
106
+ # image
107
+ # src = psoc5lp_board.jpg
108
+ # align = center
109
+ # relative-height = 30
110
+ * PSoC5LP Prototyping Kit
111
+ * for prototyping and small production
112
+ * you can purchase with 秋月電子通商(akizukidenshi.com)
113
+
114
+ = mruby/c works on only PSoC5LP?
115
+
116
+ = mruby/c works on only PSoC5LP?
117
+ * yes and no
118
+ * the number of microcontroller on which mruby/c runs is increasing
119
+ * PSoC5LP is the most recommended one. because it has a good example, my project
120
+ * PSoC5LP is very resonable to develop IoT product especially for mass production
121
+ * IMO, the mruby/c core team made the right choice
122
+
123
+ = about my IoT project
124
+
125
+ = about my IoT project
126
+ * IoT system for asahi-san
127
+ * delivered to actual brew work in January 2018
128
+ * devices post temperature of Sake materials in brewing, surrounding temperature and humidity to server
129
+ * data is displayed on smartphone app
130
+
131
+ = about my IoT project
132
+ # image
133
+ # src = kamosu.png
134
+ # align = center
135
+ # relative-height = 95
136
+
137
+ = about my IoT project
138
+ : what were difficult about mruby/c?
139
+ * we can neither do step execution nor look into appropriate memory address of mruby/c's variables
140
+ * so many factors to be trouble in IoT
141
+ * hard to find why the application doesn't work well
142
+ * mruby/c is growing
143
+ * bugs, lack of docs and examples
144
+
145
+ = about my IoT project
146
+ : so, is mruby/c bad?
147
+
148
+ = about my IoT project
149
+ : so, is mruby/c bad? - NO
150
+ * IoT at work makes you hurry
151
+ * you have to go alternately to dark 10℃ storage cellar and humid 35℃ manufacturing room
152
+ * brewery workers run around
153
+ * you have to amend your firmware with your small laptop in 10 minutes
154
+ * you will thank Ruby's descriptiveness and agility
155
+
156
+ = today's demo
157
+ * CO(('sub:2')) concentration
158
+ * 400ppm : atmospheric
159
+ * 1000ppm : your programming speed decreases
160
+ * 1500ppm : tomatoes((*🍅*)) may grow well
161
+ * > 2000ppm : sleepy, headache
162
+ * > 40000ppm : 💀
163
+ * HD = humidity deficit = 飽差
164
+ * 3~6g : tomatoes((*🍅*)) grow well
165
+
166
+ = so many factors to be trouble in IoT
167
+
168
+ = so many factors to be trouble in IoT
169
+ * peripheral equipments (☆)
170
+ * circuit and wiring design
171
+ * printed circuit board = PCB
172
+ * soldering (☆)
173
+ * C, mruby and mruby/c (☆)
174
+ * communication timing control (☆)
175
+ * network
176
+ ☆...I will explain these topics
177
+
178
+ = peripheral equipments
179
+
180
+ = peripheral equipments
181
+ * it is very important to check these things before writing application code
182
+ * equipment like sensor or communication module works as its spec sheet
183
+ * whether the equipment is not broken (sometimes broken by soldering 😭)
184
+ * unless you will regret
185
+ * so...
186
+
187
+ = peripheral equipments
188
+ # image
189
+ # src = raspberrypi.jpg
190
+ # relative-height = 55
191
+
192
+ * Raspberry Pi & CRuby are great for pre-prototyping
193
+ * use breadboard or make PCB for test like this photo
194
+
195
+ = peripheral equipments
196
+ ex) CRuby for serial communication test
197
+ # enscript ruby
198
+ # notice this is CRuby for RasPi
199
+ require 'rubyserial'
200
+ require 'timeout'
201
+ BAUDRATE = 9600 # match with your instrument
202
+ sp = Serial.new '/dev/serial0', BAUDRATE, 8
203
+ loop do
204
+ puts '[command]'
205
+ command = gets
206
+ sp.write command.sub("\n", "\r") # replace LF if needed
207
+ sleep 0.1
208
+ result = ''
209
+ begin
210
+ Timeout.timeout(10) do
211
+ loop do
212
+ line = sp.read(128)
213
+ break if line == '' && result != ''
214
+ result << line
215
+ sleep 0.1
216
+ puts '=> ' + result
217
+ rescue Timeout::Error
218
+ puts 'timeout!'
219
+ ennnnd
220
+
221
+ = peripheral equipments
222
+ ex) CRuby for serial communication test
223
+ # enscript bash
224
+ $ serial_communication_test.rb
225
+ [command]
226
+ AT # command
227
+ => OK # response
228
+ [command]
229
+ AT+CIMI # command
230
+ => 123456789012 # response
231
+ [command]
232
+ AT+XXX # command
233
+ => error # response
234
+
235
+ = soldering
236
+
237
+ = soldering
238
+ # image
239
+ # src = unsoldered.jpg
240
+ # relative-width = 35
241
+
242
+ * it may work even if you leave a pin unsoldered on surface mounting
243
+ * because the pin touches circuit
244
+ * then, it will not work one day
245
+
246
+ = soldering
247
+ # image
248
+ # src = unsoldered-2.png
249
+ # relative-width = 35
250
+
251
+ * all the cause of failure, it is ((*impatience*))
252
+ * すべての失敗の原因、それは((*焦り*))
253
+
254
+ = soldering
255
+ # image
256
+ # src = tranquilo.jpg
257
+ # relative-height = 100
258
+
259
+ = ((' '))
260
+ # image
261
+ # src = shinjiko.jpg
262
+ # align = center
263
+ # relative-height = 100
264
+
265
+ = mruby and mruby/c
266
+
267
+ = mruby and mruby/c
268
+ : mruby
269
+ * an ecosystem of interpreter, compiler(((*mrbc*))), shell(mirb) and virtual machine and mrbgems
270
+ : mruby/c
271
+ * VM(smaller than mruby), ((*rrt0*)) and hal(hardware abstraction layer)
272
+
273
+ = mruby and mruby/c
274
+ # image
275
+ # src = mruby_and_mrubyc.png
276
+ # align = center
277
+ # relative-height = 95
278
+
279
+ = mruby and mruby/c
280
+ # RT
281
+
282
+ mruby, mruby/c
283
+
284
+ v1.0.0 in Jan 2014, v1.0 in Jan 2017
285
+ mrbgems, no package manager
286
+ RAM < N*100KB, RAM < 64KB
287
+
288
+ = coming up features to mruby/c
289
+ * task priority
290
+ * at this point, tasks run as simple round robbin schedule, although we can use Mutex
291
+ * instance variable
292
+ * at this point, you can use constants and globals
293
+ in fact, you can use these features above. just not announced
294
+
295
+ = coming up features to mruby/c
296
+ * compile option of including <math.h>
297
+ * to reduce memory usage
298
+ * Array#each and Hash#each
299
+ * and Hash#to_json will come
300
+ * note that now you can compile `#each` with mrbc but it will not run on mruby/c's VM
301
+ * in short, mruby/c VM has less methods than mruby VM
302
+
303
+ = how does mruby/c work
304
+
305
+ = how does mruby/c work
306
+ # enscript bash
307
+ ~/sample_project
308
+ ├── main.c
309
+ ├── mrblib
310
+ │  ├── job_1.rb
311
+ │ └── job_2.rb
312
+ └── src
313
+ ├── job_1.c
314
+ └── job_2.c
315
+ * job_*.c are compliled code from job_*.rb
316
+
317
+ = how does mruby/c work
318
+ # image
319
+ # src = mrubyc.png
320
+ # align = center
321
+ # relative-height = 95
322
+
323
+ = how does mruby/c work
324
+ # enscript c
325
+ /* main.c */
326
+ #include "src/job_1.c"
327
+ #include "src/job_2.c"
328
+ // use 30KB RAM for VMs in this case
329
+ #define MEMORY_SIZE (1024*30)
330
+ static uint8_t memory_pool[MEMORY_SIZE];
331
+ int main(void) {
332
+ mrbc_init(memory_pool, MEMORY_SIZE);
333
+ mrbc_create_task(job_1, 0);
334
+ mrbc_create_task(job_2, 0);
335
+ mrbc_run(); // 2 tasks run concurrently!
336
+ return 0;
337
+ // we will not write `main loop` in main.c
338
+ }
339
+
340
+ = how does mruby/c work
341
+ * we can run easily multiple VMs with ((*concurrency*)) due to ((*rrt0*))
342
+ * you might be disappointed to know you have to write C
343
+ * yes, we have to write ((*main.c*))
344
+ * don't worry, it's almost boilerplate code
345
+
346
+ = how does mruby/c work
347
+ # enscript bash
348
+ ~/mrubyc $ tree src -P *.h
349
+ src
350
+ ├── alloc.h
351
+ ├── c_array.h
352
+ ...
353
+ ├── console.h
354
+ ├── errorcode.h
355
+ ├── global.h
356
+ ├── hal_posix
357
+ │ └── hal.h
358
+ ├── hal_psoc5lp
359
+ │ └── hal.h
360
+ ├── load.h
361
+ ├── mrubyc.h
362
+ ├── opcode.h
363
+ ├── rrt0.h
364
+ ├── static.h
365
+ ├── symbol.h
366
+ ├── value.h
367
+ ├── vm.h
368
+ └── vm_config.h
369
+
370
+ = how does mruby/c work
371
+ # enscript bash
372
+ ~/mrubyc $ tree src -P *.h
373
+ src
374
+ ├── alloc.h
375
+ ├── c_array.h
376
+ ...
377
+ ├── console.h
378
+ ├── errorcode.h
379
+ ├── global.h
380
+ ├── hal_posix
381
+ │ └── hal.h # hal for posix
382
+ ├── hal_psoc5lp
383
+ │ └── hal.h # hal for PSoC5LP
384
+ ├── load.h
385
+ ├── mrubyc.h
386
+ ├── opcode.h
387
+ ├── rrt0.h
388
+ ├── static.h
389
+ ├── symbol.h
390
+ ├── value.h
391
+ ├── vm.h
392
+ └── vm_config.h
393
+
394
+ = how does mruby/c work
395
+ # enscript bash
396
+ ~/mrubyc $ tree src -P *.h
397
+ src
398
+ ├── alloc.h
399
+ ├── c_array.h
400
+ ...
401
+ ├── console.h
402
+ ├── errorcode.h
403
+ ├── global.h
404
+ ├── hal_posix
405
+ │ └── hal.h
406
+ ├── hal_psoc5lp
407
+ │ └── hal.h
408
+ ├── load.h
409
+ ├── mrubyc.h
410
+ ├── opcode.h
411
+ ├── rrt0.h # runtime scheduler
412
+ ├── static.h
413
+ ├── symbol.h
414
+ ├── value.h
415
+ ├── vm.h
416
+ └── vm_config.h
417
+
418
+ = how does mruby/c work
419
+ # enscript bash
420
+ ~/mrubyc $ tree src -P *.h
421
+ src
422
+ ├── alloc.h
423
+ ├── c_array.h
424
+ ...
425
+ ├── console.h
426
+ ├── errorcode.h
427
+ ├── global.h
428
+ ├── hal_posix
429
+ │ └── hal.h
430
+ ├── hal_psoc5lp
431
+ │ └── hal.h
432
+ ├── load.h
433
+ ├── mrubyc.h
434
+ ├── opcode.h
435
+ ├── rrt0.h
436
+ ├── static.h
437
+ ├── symbol.h
438
+ ├── value.h # this gives you hints about variable
439
+ ├── vm.h
440
+ └── vm_config.h
441
+
442
+ = how does mruby/c work
443
+ # enscript bash
444
+ ~/mrubyc $ tree src -P *.h
445
+ src
446
+ ├── alloc.h
447
+ ├── c_array.h
448
+ ...
449
+ ├── console.h
450
+ ├── errorcode.h
451
+ ├── global.h
452
+ ├── hal_posix
453
+ │ └── hal.h
454
+ ├── hal_psoc5lp
455
+ │ └── hal.h
456
+ ├── load.h
457
+ ├── mrubyc.h
458
+ ├── opcode.h
459
+ ├── rrt0.h
460
+ ├── static.h
461
+ ├── symbol.h
462
+ ├── value.h
463
+ ├── vm.h
464
+ └── vm_config.h # edit this if needed
465
+
466
+ = debugging
467
+ * we can neither do step execution nor look into memory to see mruby/c variables
468
+ * before writing app code, we should prepare way of debug
469
+ * let's go with ((*old-fashioned 'print debug'*)). it'll be almost enough
470
+
471
+ = debugging
472
+ # enscript c
473
+ /* add this snippet into main.c */
474
+ // create serial console with UART for debug print
475
+ // http://www.s-itoc.jp/activity/research/mrubyc/mrubyc_tutorial/737
476
+ static void c_debugprint(mrb_vm *vm, mrb_value *v, int argc){
477
+ int total, used, free, fragment;
478
+ mrbc_alloc_statistics(&total, &used, &free, &fragment);
479
+ console_printf(
480
+ "Memory total:%d, used:%d, free:%d, fragment:%d\n",
481
+ total, used, free, fragment);
482
+ unsigned char *key = GET_STRING_ARG(1);
483
+ unsigned char *value = GET_STRING_ARG(2);
484
+ console_printf("%s:%s\n", key, value );
485
+ }
486
+ int hal_write(int fd, const void *buf, int nbytes){
487
+ UART_DEBUG_PutArray(buf, nbytes);
488
+ return nbytes;
489
+ }
490
+ int hal_flush(int fd){
491
+ return 0;
492
+ }
493
+ int main(void) {
494
+ mrbc_define_method(0, mrbc_class_object, "debugprint", c_debugprint);
495
+ }
496
+
497
+ = debugging
498
+ # enscript ruby
499
+ # mruby
500
+ pi = 3.14
501
+ debugprint('Pi', pi)
502
+
503
+ => # print in serial console like 'PuTTY' connecting USB
504
+ Memory total:30000, used:20000, free:10000, fragment:3
505
+ Pi:3.14
506
+
507
+ = actual source code
508
+ http://github.com/\nhasumikin/rubykaigi2018_demo.cydsn
509
+
510
+ = actual source code
511
+ # enscript bash
512
+ ~/rubykaigi2018_demo.cydsn
513
+ ├── main.c
514
+ ├── mrblib
515
+ │ ├── job_3gmodule.rb # transmit JSON data to cloud
516
+ │ ├── job_breath.rb # hit 3gmodule periodically to send data
517
+ │ ├── job_co2.rb # measure CO2 concentration
518
+ │ ├── job_heartbeat.rb # show values on LED
519
+ │ └── job_humidity_deficit.rb # measure humidity deficit(HD)
520
+ └── src
521
+ ├── job_3gmodule.c
522
+ ├── job_breath.c
523
+ ├── job_co2.c
524
+ ├── job_heartbeat.c
525
+ └── job_humidity_deficit.c
526
+
527
+ = actual source code
528
+ # enscript ruby
529
+ # job_heartbeat.rb
530
+ $mutex = Mutex.new # rrt0 has Mutex functionality
531
+ while true # this is a `main loop`
532
+ r_LED_Driver_ClearDisplayAll # wrapper method of C func
533
+ $co2 = measure_co2 # defined in job_co2.rb
534
+ $hd = measure_humidity_deficit # job_humidity_deficit.rb
535
+ $mutex.lock() # to prevent other jobs from overwriting LED
536
+ r_LED_Driver_WriteString7Seg(sprintf('%4d', $co2), 0)
537
+ r_LED_Driver_WriteString7Seg(sprintf('%3.0f', $hd * 10), 4)
538
+ r_LED_Driver_PutDecimalPoint(1, 5)
539
+ r_LED_Driver_WriteString7Seg('g', 7)
540
+ $mutex.unlock()
541
+ sleep 3
542
+ end
543
+
544
+ how does\n
545
+ r_LED_Driver_WriteString7Seg() work?
546
+
547
+ = actual source code
548
+ # enscript c
549
+ /* add into main.c */
550
+ #include "src/job_heartbeat.c"
551
+ static void c_LED_Driver_WriteString7Seg(
552
+ mrb_vm *vm, mrb_value *v, int argc){
553
+ char *string = GET_STRING_ARG(1); // see value.h
554
+ int position = GET_INT_ARG(2);
555
+ // this is defined in IDE's framework
556
+ LED_Driver_WriteString7Seg(string, position);
557
+ }
558
+ int main(void){
559
+ ...
560
+ mrbc_define_method(0, mrbc_class_object,
561
+ "r_LED_Driver_WriteString7Seg",
562
+ c_LED_Driver_WriteString7Seg);
563
+ ...
564
+ }
565
+
566
+ = actual source code
567
+ # enscript ruby
568
+ # job_breath.rb
569
+ $state = 'initializing'
570
+ while !$mutex # wait until main loop runs
571
+ relinquish()
572
+ end
573
+ sleep 10 # wait for 3G module starts
574
+ $state = 'waiting' if check_3gmodule
575
+ while true
576
+ if $state != 'sending'
577
+ $state = 'ready_to_send'
578
+ end
579
+ sleep 300 # send data every 5 mins
580
+ end
581
+
582
+ = actual source code
583
+ # enscript ruby
584
+ # job_3gmodule.rb(excerpt)
585
+ while true
586
+ if $state == 'ready_to_send'
587
+ $state = 'sending'
588
+ i = 0
589
+ while true
590
+ flag = send_data(json($co2, $humidity_deficit))
591
+ if flag
592
+ $mutex.lock()
593
+ r_LED_Driver_WriteString7Seg('sendgood', 0)
594
+ sleep 1
595
+ $mutex.unlock()
596
+ break
597
+ else
598
+ $mutex.lock()
599
+ r_LED_Driver_WriteString7Seg('sendfail', 0)
600
+ sleep 1
601
+ r_LED_Driver_WriteString7Seg('retry', 0)
602
+ sleep 1
603
+ $mutex.unlock()
604
+ end
605
+ if i > 2
606
+ j = 0
607
+ $mutex.lock()
608
+ while j < 20
609
+ j += 1
610
+ r_LED_Driver_WriteString7Seg('fatalerr', 0)
611
+ sleep 0.2
612
+ r_LED_Driver_ClearDisplayAll
613
+ sleep 0.05
614
+ break
615
+ end
616
+ $mutex.unlock()
617
+ end
618
+ i += 1
619
+ end
620
+ debugprint('memory', 'check')
621
+ $state = 'waiting'
622
+ ennd
623
+
624
+ = actual source code
625
+ # enscript ruby
626
+ # job_co2.rb does not have loop
627
+ def measure_co2
628
+ r_UART_CO2_ClearTxBuffer
629
+ r_UART_CO2_ClearRxBuffer
630
+ ary = [0xff,0x01,0x86,0x00,0x00,0x00,0x00,0x00,0x79]
631
+ r_UART_CO2_PutArray(ary, ary.size) # this will be explained
632
+ res = []
633
+ i = 0
634
+ # can't write `for i in 0..3`, equiv. of #each
635
+ while i < 4
636
+ res[i] = r_UART_CO2_GetByte
637
+ i += 1
638
+ end
639
+ if res[0] == 255 && res[1] == 134
640
+ return res[2] * 256 + res[3]
641
+ else
642
+ return false
643
+ ennd
644
+
645
+ = actual source code
646
+ # enscript c
647
+ /* add into main.c */
648
+ // mruby array should be converted into C array
649
+ static void c_UART_CO2_PutArray(
650
+ mrb_vm *vm, mrb_value *v, int argc){
651
+ mrb_value mrbc_array = GET_ARY_ARG(1);
652
+ uint8 array[GET_INT_ARG(2)];
653
+ for( int i = 0; i < GET_INT_ARG(2); i++ ) {
654
+ mrb_value value = mrbc_array_get(&mrbc_array, i);
655
+ array[i] = value.i;
656
+ }
657
+ UART_CO2_PutArray(array, GET_INT_ARG(2));
658
+
659
+ uint8 tmpStat;
660
+ do { // will be explained later
661
+ tmpStat = UART_CO2_ReadTxStatus();
662
+ } while (~tmpStat & UART_CO2_TX_STS_COMPLETE);
663
+ }
664
+
665
+ = actual source code
666
+ * you can pass string instead of mruby/c array
667
+ * it was a sample to handle mrb_value
668
+ * I also wanted argument class(Array) to correspond with method name(xxx_PutArray)
669
+ * use string instead of array if memory becomes short
670
+
671
+ = actual source code
672
+ # enscript c
673
+ /* add into main.c */
674
+ // mruby array should be converted into C array
675
+ static void c_UART_CO2_PutArray(
676
+ mrb_vm *vm, mrb_value *v, int argc){
677
+ mrb_value mrbc_array = GET_ARY_ARG(1);
678
+ uint8 array[GET_INT_ARG(2)];
679
+ for( int i = 0; i < GET_INT_ARG(2); i++ ) {
680
+ mrb_value value = mrbc_array_get(&mrbc_array, i);
681
+ array[i] = value.i;
682
+ }
683
+ UART_CO2_PutArray(array, GET_INT_ARG(2));
684
+
685
+ uint8 tmpStat;
686
+ do { // communication timing control here
687
+ tmpStat = UART_CO2_ReadTxStatus();
688
+ } while (~tmpStat & UART_CO2_TX_STS_COMPLETE);
689
+ }
690
+
691
+ = actual source code
692
+ * communication of microcontroller takes time
693
+ * we will not get notification something like callback from peripheral
694
+ * we have to wait until it's ready
695
+ * we can write another wrapper for waiting
696
+ * but we want to reduce memory usage
697
+
698
+ = development environment
699
+
700
+ = development environment
701
+ * IDE `PSoC Creator`
702
+ * you need to use it for periferal arrangement and pin assignment
703
+
704
+ = development environment
705
+ * IDE `PSoC Creator`
706
+ * you need to use it for periferal arrangement and pin assignment
707
+ * runs ((*only on Windows*))
708
+
709
+ = development environment
710
+ # image
711
+ # src = IDE.png
712
+ # align = center
713
+ # relative-height = 95
714
+
715
+ = development environment
716
+ * do you hate IDE?
717
+
718
+ = development environment
719
+ * do you hate IDE?
720
+ * ((*#MeeToo*))
721
+
722
+ = development environment
723
+ * do you hate IDE?
724
+ * ((*#MeeToo*))
725
+ * I made a tool for Linux and macOS
726
+ * github.com/hasumikin/((*mrubyc-utils*))
727
+
728
+ # image
729
+ # src = mrubyc-utils.png
730
+ # align = center
731
+ # relative-height = 120
732
+
733
+ = development environment
734
+ your_project $ mrubyc-utils --help
735
+ Usage: mrubyc-utils COMMAND [ARGS]
736
+
737
+ install Install mruby/c repo into your local and setup templates.
738
+ Please run this command at the top directory
739
+ of your project (normally it should have 'main.c').
740
+ update Update mruby/c repo to the newest master branch.
741
+ checkout Checkout specified tag or commit of mruby/c repo.
742
+ -t | --tag [required] You can specify anything that
743
+ `git checkout` will accept.
744
+ tag Show all tags of mruby/c repogitory that you installed.
745
+ classes Show all the classes that are defined in
746
+ mruby/c's virtual machine.
747
+ methods Show all the methods that are available
748
+ in specified class of mruby/c.
749
+ -c | --class [required] You have to specify class name
750
+ compile Compile your mruby source into C byte code.
751
+ -w | --watch [optional] Monitoring loop runs and it will
752
+ compile mruby source every time you save.
753
+
754
+ = development environment
755
+ your_project $ mrubyc-utils install
756
+ (...install mruby/c and template files)
757
+ your_project $ mrubyc-utils compile
758
+ (...you can specify --watch option)
759
+ your_project $ tree
760
+ ├── .gitignore
761
+ ├── .mrubyc/
762
+ ├── .mrubycconfig
763
+ ├── main.c
764
+ ├── mrblib
765
+ │ ├── job_main_loop.rb
766
+ │ ├── job_operations.rb
767
+ │ └── job_sub_loop.rb
768
+ ├── mrubyc_src
769
+ (...)
770
+ │ └── vm_config.h
771
+ └── src
772
+ ├── job_main_loop.c
773
+ ├── job_operations.c
774
+ └── job_sub_loop.c
775
+
776
+ = development environment
777
+ your_project $ mrubyc-utils classes
778
+ - Array
779
+ - False
780
+ - Fixnum
781
+ - Float
782
+ - Hash
783
+ - Mutex
784
+ - Nil
785
+ - Object
786
+ - Proc
787
+ - Range
788
+ - String
789
+ - Symbol
790
+ - True
791
+
792
+ = development environment
793
+ your_project $ mrubyc-utils methods --class=array
794
+ Array
795
+ - +
796
+ - <<
797
+ - []
798
+ - []=
799
+ - at
800
+ - clear
801
+ - count
802
+ - delete_at
803
+ - dup
804
+ - empty?
805
+ - first
806
+ - index
807
+ - last
808
+ - length
809
+ - pop
810
+ - push
811
+ - shift
812
+ - size
813
+ - unshift
814
+ < Object
815
+ - !
816
+ - !=
817
+ - <=>
818
+ - attr_accessor
819
+ - attr_reader
820
+ - change_priority
821
+ - class
822
+ - get_tcb
823
+ - instance_methods
824
+ - new
825
+ - p
826
+ - puts
827
+ - relinquish
828
+ - resume_task
829
+ - sleep
830
+ - sleep_ms
831
+ - sprintf
832
+ - suspend_task
833
+
834
+ = development environment
835
+ * using mrubyc-utils, you can minimize uses of IDE to these:
836
+ * build setting
837
+ * peripheral arrangement and pin assignment
838
+ * build
839
+ * then you can write app code with vim, emacs or textbringer
840
+
841
+ = what you can do for mruby/c
842
+
843
+ = what you can do for mruby/c
844
+ * write another hal
845
+ * so that mruby/c can be suitable for more microcontrollers
846
+ * write documentation, test and real applications
847
+ * publish that you use mruby/c
848
+ * posix...
849
+
850
+ = about me
851
+ # image
852
+ # src = fb_avatar.jpg
853
+ # align = center
854
+ # relative-height = 60
855
+ * HASUMI Hitoshi (羽角 均)
856
+ * Monstar Lab (モンスター・ラボ)
857
+ * Matsue office (島根開発拠点)
858
+
859
+ = conclusion
860
+
861
+ = conclusion
862
+ * you should refresh air
863
+ * 換気大事
864
+
865
+ = thank you!
866
+ # image
867
+ # src = juji-asahi.jpg
868
+ # align = center
869
+ # relative-height = 95
870
+