Compare commits

...

319 Commits

Author SHA1 Message Date
e07d6e3a31 0.0.44 2017-12-19 11:53:50 -08:00
763ad3f763 0.0.43 2017-12-19 11:38:02 -08:00
919a03951c Removing icons (#114)
* removing icons

* added "pause for light"
2017-12-19 11:37:33 -08:00
9e427898ae added test framework (#113)
* added test framework

* added toString on motors

* enabling logs
2017-12-19 07:07:50 -08:00
60bf3a17d3 a mini-console support with scroll up / down (#112)
* a mini-console support with scroll up / down

* fix compile error
2017-12-18 22:36:32 -08:00
0529759a80 Fix ultrasonic value to use cm instead of 0.1 cm units (#110)
* Fix simulator

* use 250 instead of 255
2017-12-18 20:30:56 -08:00
b07f157181 0.0.42 2017-12-18 18:24:46 -08:00
2f5f7d4133 Merge pull request #111 from Microsoft/scale_screen
Add tiny padding around the screen for the canvas.
2017-12-18 17:08:02 -08:00
e6e1dce59f Add tiny padding around the screen for the canvas. 2017-12-18 17:07:23 -08:00
43a9d03231 fixing pauseUntilReady signature 2017-12-18 14:45:44 -08:00
c0f6cd3651 test passing on hw 2017-12-18 14:31:17 -08:00
f1445c6e89 Motor pause until ready (#108)
* adding command to pause until ready

* adding console API

* adding ready support for motors

* fix time output scale

* fixing angle
2017-12-18 14:13:38 -08:00
04275ee35c 0.0.41 2017-12-18 13:22:13 -08:00
f8d0594eca Merge pull request #107 from Microsoft/initial_sim
Initial sim implementation
2017-12-18 13:21:48 -08:00
5be3b31e00 Merge branch 'master' into initial_sim 2017-12-18 13:21:35 -08:00
84c1079e50 Fix Safari bug. 2017-12-18 13:19:49 -08:00
6320379d02 Initial sim implementation 2017-12-18 13:04:17 -08:00
b166f6034e storing test 2017-12-18 09:43:44 -08:00
d07f672b28 fixing single motor set speed 2017-12-18 09:17:19 -08:00
363e076f36 fixing motor compilation 2017-12-18 08:54:53 -08:00
8bf6f265f7 Merge pull request #105 from Microsoft/motorfixes
Motor fixes
2017-12-18 00:54:53 -08:00
217958aec3 fix polarity 2017-12-17 23:19:38 -08:00
367b1b0d1a properly setting multiple-motor options 2017-12-17 23:00:07 -08:00
6836852122 refactoring motors wiht base class (#104) 2017-12-17 22:47:13 -08:00
944098b9f9 Minor refactor fix (#102)
* Minor fix to a refactor of motor output this.brake to this._brake

* No (_this) in global context

* Minor fix
2017-12-17 21:12:18 -08:00
539cf3d73e 0.0.40 2017-12-15 14:30:51 -08:00
4b3e7cfb7d bump pxt-core to 3.0.2, bump pxt-common-packages to 0.14.13, 2017-12-15 14:30:43 -08:00
b144744509 Add tsconfig.json for easier library editing (#96) 2017-12-15 14:29:31 -08:00
e591bed6ad Add 'clear screen' block to brick category (#100) 2017-12-15 14:29:10 -08:00
6a4e64eac0 Merge pull request #79 from Microsoft/motorsync
Motor sync block
2017-12-15 14:28:03 -08:00
f7dd14ff7b Merge pull request #88 from Microsoft/even_more_sounds
Add 'stopAllSounds' block
2017-12-15 11:36:31 -08:00
bfd34cedd6 Update built files 2017-12-15 11:04:16 -08:00
8e1c075911 Merge pull request #98 from Microsoft/portFixes
Fix order of color and ultrasonic sensor ports.
2017-12-15 10:45:34 -08:00
a02f364a4c Update function names for consistency 2017-12-15 10:42:44 -08:00
48fee2c215 Merge pull request #99 from Microsoft/ui_changes
Some UI theming. square buttons
2017-12-15 08:55:45 -08:00
5780d1982c Some UI theming. square buttons 2017-12-15 08:55:21 -08:00
6fb08f0f7b Fix order of color and ultrasonic sensor ports. 2017-12-15 07:48:42 -08:00
13f8659b98 Merge pull request #97 from Microsoft/startup_delay
Startup delay for sensors to get values
2017-12-15 07:05:21 -08:00
edc9d17a8c Merge pull request #95 from Microsoft/serialnumber
Implement getSerialNumber (based on BT MAC)
2017-12-15 07:04:21 -08:00
c7a3f5bbd0 Delay user code by 100ms to get sensor reading (fixes #90) 2017-12-15 11:55:20 +00:00
41d5052583 Run sensor "change handler" also with the initial value 2017-12-15 11:54:53 +00:00
07ddec343a Formatting 2017-12-15 11:30:15 +00:00
5a9a5e997a Error reporting fixes 2017-12-15 11:29:18 +00:00
55b6549999 Implement getSerialNumber (based on BT MAC) 2017-12-15 11:25:23 +00:00
fcdc350e40 more motor work 2017-12-14 17:01:23 -08:00
9dedbeae1b updated parameters 2017-12-14 13:26:04 -08:00
124d8a0fd8 tank support 2017-12-14 13:25:27 -08:00
81fcbb6916 tweaks of blocks 2017-12-14 13:07:10 -08:00
d436bd1227 Fix simulator stop() method 2017-12-14 09:41:01 -08:00
cb648019bb Progress 2017-12-14 09:17:47 -08:00
11a88a9d94 updated signatures 2017-12-13 23:00:37 -08:00
92178f3371 bring back speed 2017-12-13 22:54:08 -08:00
3c86ae286f more work on motors 2017-12-13 22:40:40 -08:00
1b6d84a9b8 Merge branch 'master' into motorsync 2017-12-13 21:16:33 -08:00
2d81be3b24 Add 'stopAllSounds' block 2017-12-13 16:31:42 -08:00
14f57f54bf Merge pull request #87 from Microsoft/motor_fix_2
Motor data fix
2017-12-13 15:56:17 -08:00
e7c697c24d Merge pull request #85 from Microsoft/on_color_fix
Fix "on color detected" block
2017-12-13 15:55:47 -08:00
7ac63f038c Merge pull request #84 from Microsoft/fix_image_attrs
Adding block identity
2017-12-13 15:55:36 -08:00
557926d631 Merge pull request #78 from Microsoft/waitUntiltopauseUntil
renaming all "wait until" to "pause until"
2017-12-13 15:52:46 -08:00
da62d51615 Merge branch 'master' into motor_fix_2 2017-12-13 15:48:43 -08:00
3918857fcc Merge branch 'master' into on_color_fix 2017-12-13 15:48:24 -08:00
f1dcebdd88 Merge branch 'master' into fix_image_attrs 2017-12-13 15:48:09 -08:00
1d35c78737 Merge branch 'master' into motorsync 2017-12-13 15:47:52 -08:00
d17326ad7a Merge branch 'master' into waitUntiltopauseUntil 2017-12-13 15:47:27 -08:00
4948a88833 Merge pull request #83 from Microsoft/new_ts_cleanup
New ts cleanup
2017-12-13 15:46:58 -08:00
b73b924ec4 ignoreing docs errors 2017-12-13 15:35:53 -08:00
641d292c33 Clean commit for motor fix 2017-12-13 14:55:14 -08:00
223275fd65 Moving a line of code 2017-12-13 13:35:28 -08:00
6e42e816d3 Adding block identity 2017-12-13 10:42:49 -08:00
5678cf5df9 Fixing test file 2017-12-13 10:29:12 -08:00
67ec4accb9 Monitor memory usage and panic on over 8MB used 2017-12-13 15:28:52 +00:00
fa867c3a34 Cleanup 2017-12-12 15:24:36 -08:00
7865876e64 Merge branch 'master' into waitUntiltopauseUntil 2017-12-12 14:19:35 -08:00
113b42656c sync command working 2017-12-12 14:08:45 -08:00
7557380722 adding sync command 2017-12-12 13:20:25 -08:00
3e2a1ec9e1 missing strings files 2017-12-12 11:23:29 -08:00
09db613620 updated docs 2017-12-12 10:49:45 -08:00
bacb4673c9 renaming all "wait until" to "pause until" 2017-12-12 10:46:56 -08:00
e649a167cd Merge pull request #74 from Microsoft/powertospeed
some speed renamings
2017-12-11 23:20:17 -08:00
997e8efb20 Merge branch 'master' of https://github.com/Microsoft/pxt-ev3 2017-12-11 17:08:12 -08:00
1f380ce959 0.0.39 2017-12-11 17:00:06 -08:00
8cbf601131 0.0.38 2017-12-11 17:00:03 -08:00
bdbb2a8c2f Fix on start color 2017-12-11 16:58:29 -08:00
5e90cb4434 Merge pull request #75 from Microsoft/new_ts
Update to latest TS and update blocks colors to match Lego's edu colors
2017-12-11 16:55:25 -08:00
1bf1eb16f0 Update to latest TS and update blocks colors to match Lego's edu colors 2017-12-11 16:55:00 -08:00
fbc6fc30a7 some speed renamings 2017-12-11 16:07:46 -08:00
fee2329ca7 Merge branch 'master' of https://github.com/Microsoft/pxt-ev3 2017-12-08 11:23:07 -08:00
5656031e2d Merge pull request #73 from Microsoft/more_sounds
Limit sound concurrency to 1
2017-12-08 11:21:21 -08:00
e87e1767b5 Null check 2017-12-08 11:16:47 -08:00
2d7a108e79 Fix merge conflict 2017-12-07 16:28:30 -08:00
193f66fd2d Limit sound concurrency to 1 2017-12-07 16:27:28 -08:00
5768fcaf35 Merge branch 'master' of https://github.com/Microsoft/pxt-ev3 2017-12-07 13:58:38 -08:00
2c22ea925f Merge pull request #69 from Microsoft/sounds
Get rid of "play sound" blocks; add non-blocking "play sound effect"
2017-12-07 11:53:04 -08:00
4e4aa266d5 Limit sound concurrency 2017-12-07 11:27:29 -08:00
05bdbd7b40 icon resources 2017-12-07 08:33:13 -08:00
085ab0844b rename "power" to "set speed" for consistency 2017-12-06 22:41:51 -08:00
4ad229cb37 0.0.37 2017-12-06 22:35:03 -08:00
170ee33848 bump pxt-core to 2.3.37, 2017-12-06 22:34:52 -08:00
162e437527 using icons on drop downs 2017-12-06 22:34:11 -08:00
ab13cb9047 adding a few more icons 2017-12-06 21:40:00 -08:00
80454f55c7 0.0.36 2017-12-06 16:31:06 -08:00
30e576345b more icon updates 2017-12-06 16:29:21 -08:00
dfc4c83718 resizing svg to sqaures
updates some icons
2017-12-06 16:22:31 -08:00
e25d273765 LEGO resources 2017-12-06 15:57:40 -08:00
903e98ca22 Merge pull request #70 from Microsoft/nodefaultinfrared
removing infrared from default ev3 configuration
2017-12-05 11:15:17 -08:00
8a64085288 enable language/high contrast 2017-12-05 10:53:26 -08:00
22ab1cba8d removing infrared from default ev3 configuration 2017-12-05 10:49:48 -08:00
064d6f9411 Check if sound not defined 2017-12-04 12:24:41 -08:00
330aff8082 Restore 'play sound effect' name 2017-12-01 09:59:59 -08:00
0886a5d4e1 Merge branch 'master' of https://github.com/Microsoft/pxt-ev3 2017-11-30 15:54:11 -08:00
aa636aef96 Separate blocks for 'play sound' and 'play sound until done' 2017-11-30 15:49:50 -08:00
1865ced312 Merge pull request #67 from Microsoft/note_default
Default piano note should be 1046
2017-11-30 15:41:55 -08:00
b940befe85 Default piano note should be 1046 2017-11-30 12:44:22 -08:00
c6bae5e17b missed files 2017-11-30 11:28:20 -08:00
83e4898eab Merge pull request #66 from Microsoft/gyroproject
moving gyro into separate project
2017-11-30 10:47:13 -08:00
7bdb9683c9 fixing naming 2017-11-30 10:37:59 -08:00
3c675892aa moving gyro into separate project 2017-11-30 10:34:34 -08:00
3d29c5e323 0.0.35 2017-11-30 10:16:04 -08:00
15d59269d4 bump pxt-core to 2.3.31, 2017-11-30 10:15:54 -08:00
73b5e7dc3f Merge pull request #65 from Microsoft/ultrasonicsensor
Ultrasonic/IR sensor refactoring work
2017-11-30 10:14:30 -08:00
a92edcffee adding waitUntil to buttons 2017-11-30 10:05:00 -08:00
305a650125 using threshold detector 2017-11-30 09:59:28 -08:00
34a5aeb7d2 moving IR as well 2017-11-30 09:53:43 -08:00
32f524ddd8 fixing build 2017-11-30 09:48:43 -08:00
b690c1634b updated distance detection 2017-11-30 09:41:34 -08:00
8089841892 wait until 2017-11-30 09:39:24 -08:00
3d8c697586 moving into separate project 2017-11-30 09:38:04 -08:00
e365e3d1be Merge pull request #64 from Microsoft/color-sensor
Color sensor refactoring
2017-11-30 08:55:50 -08:00
4ed41adb6a avoid conflicts of event values 2017-11-30 08:31:31 -08:00
39b7f99741 update mode selection 2017-11-30 08:20:00 -08:00
ad17191ae2 collapse reflected/ambient blocks 2017-11-29 22:47:17 -08:00
4a8633f506 updated descriptions 2017-11-29 22:11:59 -08:00
3690f409b0 docs skeleton 2017-11-29 22:09:12 -08:00
97663d2b83 updated naming 2017-11-29 21:57:05 -08:00
4d2b7ced71 moving color sensor to separate project 2017-11-29 21:41:00 -08:00
5676103052 Merge pull request #63 from Microsoft/speedispower
use speed when setting power
2017-11-29 21:22:32 -08:00
cb8c14fbb1 Allow waitForEvent on main thread; fixes #60
also use target_panic() instead of assert
2017-11-29 19:54:17 -03:00
815d438d86 use speed when setting power 2017-11-29 00:04:54 -08:00
da8de1e31e Merge pull request #56 from Microsoft/note 2017-11-28 17:00:57 -08:00
b028916025 Increment pxt-core and pxt-common-packages dependencies 2017-11-28 16:48:16 -08:00
b9be74bad8 Merge pull request #59 from Microsoft/touch
adding touch button examples
2017-11-28 16:35:48 -08:00
7e502b1749 adding bare docs 2017-11-28 16:24:22 -08:00
f22edac84d moving touch stuff into separate projects 2017-11-28 16:11:15 -08:00
ef2807a84e Fill in real min and max 2017-11-28 16:04:25 -08:00
580b40876c fixing bumped 2017-11-28 16:02:04 -08:00
b57ae5d588 implement wasPressed 2017-11-28 15:33:43 -08:00
71479d0caa adding touch button examples 2017-11-28 15:23:54 -08:00
7e39cdde9d Add a todo 2017-11-27 17:21:32 -08:00
85ca6b3698 Support for new data structure 2017-11-27 14:12:04 -08:00
2c89848fda More 2017-11-21 17:11:11 -08:00
ed1c187514 Initial work 2017-11-21 11:35:53 -08:00
52816e6de7 Merge pull request #51 from Microsoft/debugging
Add debug function
2017-11-20 10:54:44 -08:00
60ac3a9d00 0.0.34 2017-11-18 07:37:59 -08:00
d2c7a5ace0 support for wait/when 2017-11-18 07:37:46 -08:00
79fcd1c01e 0.0.33 2017-11-18 07:34:50 -08:00
2d48725c63 bump pxt-core to 2.3.28, bump pxt-common-packages to 0.14.3, 2017-11-18 07:34:40 -08:00
802c3db0ba 0.0.32 2017-11-17 14:12:32 -08:00
4a7e8c5fa8 adding block for sounds 2017-11-16 23:28:44 -08:00
0ebffd8549 0.0.31 2017-11-16 22:55:51 -08:00
988a2b638b add icon 2017-11-16 22:52:29 -08:00
fb743dea74 Merge pull request #50 from Microsoft/icons
Icons in blocks
2017-11-16 22:48:35 -08:00
e400637ba1 Merge branch 'master' into icons 2017-11-16 22:47:40 -08:00
b2768b1099 added showimage 2017-11-16 22:46:51 -08:00
3a5885b28e 0.0.30 2017-11-16 22:25:36 -08:00
b602b52f7d bump pxt-core to 2.3.27, 2017-11-16 22:25:26 -08:00
90afb60cc4 bump pxt-core to 2.3.26, bump pxt-common-packages to 0.14.2, 2017-11-16 22:04:29 -08:00
c936c16c33 more icons 2017-11-16 22:03:43 -08:00
ead69e3c6e Add debug function 2017-11-16 16:28:10 -08:00
d100026d5c more icons 2017-11-16 13:05:50 -08:00
41c2899feb more icons 2017-11-16 13:03:15 -08:00
9437873427 more images 2017-11-16 12:58:37 -08:00
dab281a9cb including a few icons in block names 2017-11-16 12:41:47 -08:00
f27fb4d93c 0.0.29 2017-11-09 10:29:24 -08:00
11fb82eba9 Merge pull request #49 from Microsoft/updatepxt
Update pxt
2017-11-09 19:28:55 +01:00
170e6b700b updating to latest pxt 2017-11-09 10:24:12 -08:00
387ad763f8 bump pxt-core to 2.3.19, bump pxt-common-packages to 0.12.17, 2017-11-09 10:14:47 -08:00
0e61f162bb Fix style to match latest changes in master. 2017-10-31 11:27:18 -07:00
400f01a6be fixing duplicate block id 2017-10-31 09:42:53 -07:00
afcbe69c44 0.0.28 2017-10-31 09:04:27 -07:00
9165fe09fc bump pxt-core to 2.3.6, 2017-10-31 09:04:20 -07:00
08f36fbb94 Merge pull request #30 from Microsoft/jres
Import images and sounds from ev3 EDU
2017-10-31 16:48:24 +01:00
afca2aa4d1 Merge pull request #45 from Microsoft/motorsrename
API tinkering
2017-10-31 16:43:27 +01:00
3c6c766412 removing lego resources 2017-10-30 21:54:23 -07:00
329a1e15ea simplified IR API 2017-10-30 21:39:50 -07:00
16a025f3a0 simplified motor API 2017-10-30 21:29:18 -07:00
26b975b5f2 images 2017-10-30 14:51:14 -07:00
79b9bce904 Merge branch 'master' into jres 2017-10-30 13:29:45 -07:00
d3d9fa6ca0 Merge branch 'master' into jres 2017-10-30 13:29:16 -07:00
8f5c930f76 Update UI to latest. 2017-10-30 13:21:03 -07:00
a082807455 Fix locking in waitForEvent() and sample playing 2017-10-30 19:18:01 +00:00
3469f51b7b Don't need to use freshcoat branch of pxt (#31) 2017-10-30 19:06:49 +00:00
e8e31e6aa7 Fix brick.print() 2017-10-30 19:03:45 +00:00
2df90152fe Remove debug output 2017-10-30 18:56:03 +00:00
e25590539e Add sample-playing code 2017-10-30 18:55:23 +00:00
a7795302fc Make it compile with master 2017-10-30 18:54:53 +00:00
480d89ba8e Added swift stuff 2017-10-30 11:46:06 -07:00
9487d324fd added link to gitlab 2017-10-30 11:45:02 -07:00
bfc95e075e Merge branch 'master' into jres 2017-10-30 18:48:18 +01:00
7d4ba9b2b2 0.0.27 2017-10-30 10:47:03 -07:00
71b83040e6 bump pxt-core to 2.3.5, bump pxt-common-packages to 0.12.4, 2017-10-30 10:46:56 -07:00
1976534da0 Merge pull request #28 from Microsoft/sensorscat
Aligning categories with LabView/RobotC
2017-10-30 18:46:27 +01:00
ebbbe6e86c Add sounds (only simulator for now) 2017-10-30 17:25:58 +00:00
c4a9b4a381 updated brick color 2017-10-30 09:58:00 -07:00
c7d36a5e82 moving motors up 2017-10-30 09:55:36 -07:00
c8c45be057 fixing brick groups 2017-10-30 09:51:18 -07:00
a8a7267851 Add LEGO EDU images 2017-10-30 15:34:47 +00:00
9cdb4081fd Add PNG decompressor in SIM 2017-10-30 14:42:08 +00:00
dcb398d3d5 Rename Icon to Image 2017-10-30 13:28:01 +00:00
f6e350cf9f Add separate type for Icons (same repr as buffer) 2017-10-30 13:04:12 +00:00
c085094394 Add screen::unpackPNG() 2017-10-30 12:45:37 +00:00
7c2ea7c406 fixing more groups 2017-10-28 09:20:34 -07:00
84b98a2788 brick namespace 2017-10-28 09:13:02 -07:00
4e99cd3ef1 0.0.26 2017-10-27 19:23:01 +01:00
57647318c4 Sensor fixes 2017-10-27 19:18:56 +01:00
2720698864 Fix infinite loop 2017-10-27 19:18:47 +01:00
dfe2fe3cff brick refactoring 2017-10-27 11:05:04 -07:00
18fefa2a44 output -> motors 2017-10-27 11:01:11 -07:00
c0bab4877a Merge branch 'master' of github.com:Microsoft/pxt-ev3 2017-10-27 15:17:24 +01:00
d2a1d10ada Add converter from RGF to PNG 2017-10-27 15:17:21 +01:00
bcb68d937d Merge branch 'master' of https://github.com/microsoft/pxt-ev3 2017-10-27 02:52:47 -07:00
05a8395028 stop all motors 2017-10-27 02:52:42 -07:00
3a1601a419 Add rsf2wav.js 2017-10-27 10:42:33 +01:00
712c2178d2 simplify motor API 2017-10-27 01:47:25 -07:00
12cdad72c8 added puppet 2017-10-27 00:13:51 -07:00
95076f8f24 differentiate large/medium motors 2017-10-27 00:09:00 -07:00
6391620373 added 2 more activities 2017-10-26 23:58:34 -07:00
86212e2153 added sound of color 2017-10-26 23:46:55 -07:00
98e430f3c1 added example of converted lesson 2017-10-26 22:19:16 -07:00
5c7e856e7b removed incorrect buy link 2017-10-26 21:57:48 -07:00
a47988913e 0.0.25 2017-10-26 21:27:51 -07:00
ea72dba6c7 Merge pull request #17 from Microsoft/irevents
Ultrasonic + IR events + Remote events
2017-10-27 06:25:02 +02:00
215e846a54 refactored remote button 2017-10-26 21:10:37 -07:00
21b34cb459 simplified events 2017-10-26 20:57:18 -07:00
282134f5dc refactoring IR 2017-10-26 20:51:13 -07:00
6b44352839 event for ultrasonic module 2017-10-26 20:38:17 -07:00
9a883d5672 Merge branch 'master' into irevents 2017-10-26 20:21:06 -07:00
59ce4338d3 renaming IR events 2017-10-26 20:20:24 -07:00
90560050b8 Merge pull request #16 from Microsoft/fonts
Mounting events on various sensors
2017-10-27 05:19:36 +02:00
2c72173bfe Use the _query() infrastructure for polling 2017-10-25 13:34:05 +02:00
1a5992408b added event for color changes 2017-10-24 23:10:27 -07:00
0e1a3b7e6b adding setpixel 2017-10-24 22:05:24 -07:00
ea6bfa03bd touched -> pressed 2017-10-24 21:55:37 -07:00
20d584db2b 0.0.24 2017-10-24 21:18:16 -07:00
0e4e0d8899 0.0.23 2017-10-24 21:09:56 -07:00
a18a690417 Merge pull request #12 from Microsoft/motors
Converting motors to fixed instances
2017-10-25 06:09:27 +02:00
c9d57c5e8d enabling banner 2017-10-24 21:08:02 -07:00
7e9d42a571 reset motors on start 2017-10-24 20:28:31 -07:00
1b51320edb pausing while running motor 2017-10-24 20:20:07 -07:00
4f44238237 use fixed instances for motors 2017-10-24 20:16:33 -07:00
c8ffa0ded7 fixed test 2017-10-24 18:49:15 -07:00
6b07d5f716 0.0.22 2017-10-24 18:48:30 -07:00
8784e23b60 fixed build link 2017-10-24 17:01:36 -07:00
4b8409fbc0 0.0.21 2017-10-24 16:56:52 -07:00
3237978cba Merge pull request #4 from Microsoft/blockupdate
Blocks update
2017-10-24 16:56:32 -07:00
33c8902050 aligning groups with hardware name components 2017-10-24 16:52:13 -07:00
fa6c81cf80 buttons -> brick buttons 2017-10-24 16:25:03 -07:00
46175fc7db separating touch sensor stuff 2017-10-24 15:58:47 -07:00
e6ef86101f more renaming 2017-10-24 15:37:48 -07:00
c4d3d7634e fixed naming of sonar 2017-10-24 15:35:42 -07:00
b0380fbef8 more annotations 2017-10-24 15:33:28 -07:00
c85c68ab68 fixing color / gyro 2017-10-24 15:22:07 -07:00
334d5aca9a on/off field editors on motors 2017-10-24 15:03:21 -07:00
1330a0fb82 fixed gyro def 2017-10-24 14:54:36 -07:00
005447ce44 4 times more sensors\! 2017-10-24 19:58:52 +01:00
60d5271de2 Merge branch 'master' into blockupdate 2017-10-24 10:02:27 -07:00
e3ab6ace55 0.0.20 2017-10-24 10:01:49 -07:00
5f4488dea7 Merge pull request #3 from Microsoft/pxtupdate
Updated to latest of pxt / common
2017-10-24 10:00:41 -07:00
07dc3bdae1 fixing docs compilation 2017-10-24 09:55:38 -07:00
5d5d78ced0 compiled strings 2017-10-24 09:47:30 -07:00
fe46461c4c adding a few more blocks 2017-10-24 05:30:05 -07:00
ccda971fd1 Bump PXT and common packages 2017-10-24 12:50:00 +01:00
8fa6cf41ca updated build files 2017-10-23 13:43:59 -07:00
aa3c6d5fc0 bump pxt-core to 2.3.1, bump pxt-common-packages to 0.10.16, 2017-10-23 13:41:38 -07:00
6a719e7718 Use field toggle for switching the motor on / off 2017-10-04 17:04:26 -04:00
b18b8333d0 Remove button group 2017-10-03 02:31:06 -04:00
84d80131d4 Various UI fixes. Block refactoring and adding touch and color blocks. 2017-10-03 02:28:44 -04:00
4977358718 0.0.19 2017-09-15 10:06:47 -07:00
15b2ef6c92 Update theme.config 2017-09-15 10:06:33 -07:00
e0288ed741 bump pxt-core to 2.0.49, bump pxt-common-packages to 0.9.6, 2017-09-15 10:04:01 -07:00
df1caf9741 0.0.18 2017-09-01 16:50:18 -07:00
a755420d06 bump pxt-core to 2.0.34, bump pxt-common-packages to 0.9.3, 2017-09-01 16:50:13 -07:00
a139727fea 0.0.17 2017-08-28 21:52:26 -07:00
48e081e584 Update json strings 2017-08-28 21:52:09 -07:00
124ad5c915 bump pxt-core to 2.0.29, 2017-08-28 21:51:33 -07:00
75a571fda7 Update README.md 2017-08-14 14:35:03 -07:00
bb842056d4 0.0.16 2017-08-10 17:11:02 -07:00
41b023f83f bump pxt-core to 2.0.12, 2017-08-10 17:10:57 -07:00
1ff058460f Split out blockly into blockly.less 2017-08-10 17:10:08 -07:00
cb0895f166 Moving UF2 related code away from this repo 2017-08-10 09:49:30 -07:00
1340fd0162 0.0.15 2017-08-09 10:03:14 -07:00
a3f56f4c9a Fix pattern enum decompilation and setSpeed when no speed is set. 2017-08-09 10:02:58 -07:00
c0e2252157 0.0.14 2017-08-08 13:45:39 -07:00
92ad67315b bump pxt-core to 2.0.10, 2017-08-08 13:45:33 -07:00
8b3064f4e0 0.0.13 2017-08-08 13:05:00 -07:00
138709285a bump pxt-core to 2.0.9, 2017-08-08 13:04:55 -07:00
65dd4617f1 Add get speed block 2017-08-08 13:02:11 -07:00
bdc8c1c62c bump pxt-core to 2.0.8, 2017-08-08 12:04:54 -07:00
ebcde71950 Fix hid deployment from command line 2017-08-08 11:47:10 +02:00
d42117a2a5 Add reading motor speed data (untested) 2017-08-08 11:41:47 +02:00
b0145cf378 Fix test.ts so it compiles 2017-08-08 11:41:31 +02:00
868ee826ab 0.0.12 2017-08-07 23:40:14 -07:00
ce489bba56 Update core-strings 2017-08-07 23:39:54 -07:00
b0944ba431 Change say to print. 2017-08-07 21:50:45 -07:00
8736d32f09 Add screen blocks 2017-08-07 21:50:04 -07:00
f8c481555c 0.0.11 2017-08-07 17:39:55 -07:00
15f50966aa Update motor APIs 2017-08-07 17:39:37 -07:00
88e21db35e fixing raiseEvent 2017-08-07 12:07:43 -07:00
4e9d3aa413 0.0.10 2017-08-07 11:33:51 -07:00
1efad776e6 bump pxt-core to 2.0.6, 2017-08-07 11:33:46 -07:00
5e7af872b5 Add setLights shadow block 2017-08-07 10:19:38 -07:00
17683033b1 Add branch info 2017-08-07 12:15:56 +02:00
31f3d108c5 Update build instructions 2017-08-07 12:15:06 +02:00
b45bf7512c 0.0.9 2017-08-07 11:13:05 +02:00
2dec405a9b Catch errors from initAsync 2017-08-07 11:12:52 +02:00
29009aa5e5 0.0.8 2017-08-07 11:08:15 +02:00
86011827dc Fix initialization without HID 2017-08-07 10:56:21 +02:00
c20cfab069 Fix web deployment, only use HF2 when in localhost (#2) 2017-08-05 17:54:18 +01:00
197f9096f8 0.0.7 2017-08-04 22:53:11 -07:00
6d499cb683 Fix package.json 2017-08-04 22:52:53 -07:00
282 changed files with 14442 additions and 17491 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ videos/**
lib/
.vscode/
bin
scripts/out.*

View File

@ -1,15 +1,17 @@
# LEGO Mindstorms EV3 target for PXT
[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Private/pxt_project_pink/master/pxt-ev3_Push)](https://ci2.dot.net/job/Private/job/pxt_project_pink/job/master/job/pxt-ev3_Push/)
[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Private/pxt_project_rainbow/master/pxt-ev3_Push)](https://ci2.dot.net/job/Private/job/pxt_project_rainbow/job/master/job/pxt-ev3_Push/)
This repo contains the editor target hosted at https://lego.makecode.com
This repo contains the editor target hosted at https://d541eec2-1e96-4b7b-a223-da9d01d0337a.pxt.io/
Issue tracker: https://src.education.lego.com/groups/ev3-makecode
## Local Dev setup
These instructions assume familiarity with dev tools and languages.
* install Node.js 6+
* install [yotta](http://docs.yottabuild.org/#installing)
* install Docker; make sure `docker` command is in your `PATH`
* (optional) install [Visual Studio Code](https://code.visualstudio.com/)
In a common folder,

View File

@ -1,12 +0,0 @@
all: mod uf2
mod:
$(MAKE) -C .. MOD=d_usbdev M=`pwd`/kernel ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
@mkdir -p bin
cp kernel/*.ko bin/
uf2:
$(MAKE) -C uf2daemon
@mkdir -p bin
cp uf2daemon/server bin/uf2d

View File

@ -1,35 +0,0 @@
# Support code to run on EV3 brick
## Kernel module
Kernel module is based on LEGO's `d_usbdev` module, with the addition of slightly modified `g_mass_storage`
module from the Linux kernel. The module and supporting sources are licensed under GPLv2 (since
they are derived from GPLv2 code).
### Modifications
* the `d_usbdev` uses the composite framework to register an additional mass storage function in addtion
to the pre-existing custom USB HID function
* the `g_mass_storage` module has the following changes:
* additional `/sys/.../lun0/active` entry is added, which allows for signaling drive eject to the host
* `d_usbdev` has an additional `ioctl()` to pretend data came from the USB host - this can be used to direct
the VM to do stuff
### Kernel modifications
The kernel itself has modified FIFO queue sizes. The LEGO kernel uses `1024` for `ep1in` and `ep1out`,
and then `64` for `ep2` and `ep3`. Note that this is non-standard modification done with a kernel patch,
that I didn't manage to find. The MSD requires `512` for `ep2` and `ep3`. I have binary edited the kernel
to do so.
Note that there's 4k of FIFO memory in the hardware. If you set the queue sizes with a sum of more than
4k, the kernel will hang, and you will not know why.
## UF2 Daemon
The [UF2](https://github.com/Microsoft/uf2) daemon is based on
[UF2 ATSAMD21](https://github.com/Microsoft/uf2-samd21) bootloader code. It exposes a virtual
FAT16 file system over Linux Network Block Device interface (`/dev/nbd0` to be precise).
This device is then exposed via the `g_mass_storage` module to the host computer.
The Daemon is licensed under MIT.

View File

@ -1,10 +0,0 @@
#!/bin/sh
set -ex
echo Y > /sys/module/printk/parameters/time
cd /mnt/ramdisk/prjs/ko
#echo 3 > /proc/sys/kernel/printk
insmod ./nbd.ko
sleep 1
./uf2d /dev/nbd1 > /tmp/uf2d.log 2> /tmp/uf2derr.log
sleep 1
insmod ./d_usbdev.ko file=/dev/nbd1 HostStr=EV3 SerialStr=0016535543af

View File

@ -1,2 +0,0 @@
obj-m += $(MOD).o

File diff suppressed because it is too large Load Diff

View File

@ -1,762 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
* This UsbDev file is based on and inheritated from
* the original file (zero.c) and work done by David Brownell
*
* >> zero.c -- Gadget Zero, for USB development <<
*
* >> Copyright (C) 2003-2008 David Brownell <<
* >> Copyright (C) 2008 by Nokia Corporation <<
*
*/
/*! \page UsbdevModule USB device Module
*
*
*- \subpage UsbdevModuleResources
*/
#ifndef PCASM
#include <asm/types.h>
#endif
#include "source/lms2012.h"
#include "source/am1808.h"
#define MODULE_NAME "usbdev_module"
#define DEVICE1_NAME USBDEV_DEVICE
static int ModuleInit(void);
static void ModuleExit(void);
#define __USE_POSIX
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sched.h>
#ifndef PCASM
#include <linux/hrtimer.h>
#include <linux/mm.h>
#include <linux/hrtimer.h>
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/ioport.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>
#include <linux/hid.h>
#include <linux/utsname.h>
#include <linux/device.h>
static struct fsg_common *fsg_common;
#include "computil.c" // The composite framework used as utility file
#include <../drivers/usb/gadget/gadget_chips.h>
#include <../drivers/usb/gadget/usbstring.c>
#include <../drivers/usb/gadget/config.c>
#include <../drivers/usb/gadget/epautoconf.c>
#include "f_mass_storage.c"
/*-------------------------------------------------------------------------*/
/*
* Kbuild is not very cooperative with respect to linking separately
* compiled library objects into one module. So for now we won't use
* separate compilation ... ensuring init/exit sections work to shrink
* the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/
#include <../drivers/usb/gadget/g_zero.h>
#define MAX_EP_SIZE 1024
#define MAX_FULLSPEED_EP_SIZE 64
unsigned buflen = MAX_EP_SIZE ;
char usb_char_buffer_in[MAX_EP_SIZE];
char usb_full_buffer_in[MAX_FULLSPEED_EP_SIZE];
int usb_char_in_length = 0;
char usb_char_buffer_out[MAX_EP_SIZE];
char usb_full_buffer_out[MAX_FULLSPEED_EP_SIZE];
int usb_char_out_length = 0;
#define SHM_LENGTH (sizeof(UsbSpeedDefault))
#define NPAGES ((SHM_LENGTH + PAGE_SIZE - 1) / PAGE_SIZE)
static void *kmalloc_ptr;
#include "usb_function.c" // Specific USB functionality
/*-------------------------------------------------------------------------*/
MODULE_LICENSE("GPL");
MODULE_AUTHOR("The LEGO Group");
MODULE_DESCRIPTION(MODULE_NAME);
MODULE_SUPPORTED_DEVICE(DEVICE1_NAME);
module_init(ModuleInit);
module_exit(ModuleExit);
#else
// Keep Eclipse happy
#endif
// USB main stuff
#define DRIVER_VERSION "31jan2011->"
#ifndef PCASM
module_param(buflen, uint, 0);
#else
// Keep Eclipse happy
#endif
static int loopdefault = 0;
#ifndef PCASM
module_param(loopdefault, bool, S_IRUGO|S_IWUSR);
#else
// Keep Eclipse happy
#endif
#define DRIVER_VENDOR_NUM 0x0694 // LEGO Group
#define DRIVER_PRODUCT_NUM 0x0005 // No. 5 in a row
#define DEFAULT_AUTORESUME 0
/* If the optional "autoresume" mode is enabled, it provides good
* functional coverage for the "USBCV" test harness from USB-IF.
* It's always set if OTG mode is enabled.
*/
unsigned autoresume = DEFAULT_AUTORESUME;
module_param(autoresume, uint, S_IRUGO);
#ifndef PCASM
MODULE_PARM_DESC(autoresume, "zero, or seconds before remote wakeup");
#else
// Keep Eclipse happy
#endif
/*-------------------------------------------------------------------------*/
static struct usb_device_descriptor device_desc = {
.bLength = sizeof device_desc,
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = cpu_to_le16(0x0200),
.bDeviceClass = 0xEF,
.bDeviceSubClass = 2,
.bDeviceProtocol = 1,
/*.bMaxPacketSize0 = f(hardware) */
.idVendor = cpu_to_le16(DRIVER_VENDOR_NUM),
.idProduct = cpu_to_le16(DRIVER_PRODUCT_NUM),
.bNumConfigurations = 1,
};
#ifdef CONFIG_USB_OTG
struct usb_otg_descriptor otg_descriptor = {
.bLength = sizeof otg_descriptor,
.bDescriptorType = USB_DT_OTG,
/* REVISIT SRP-only hardware is possible, although
* it would not be called "OTG" ...
*/
.bmAttributes = USB_OTG_SRP | USB_OTG_HNP,
};
const struct usb_descriptor_header *otg_desc[] = {
(struct usb_descriptor_header *) &otg_descriptor,
NULL,
};
#endif
/* string IDs are assigned dynamically */
#define STRING_MANUFACTURER_IDX 0
#define STRING_PRODUCT_IDX 1
#define STRING_SERIAL_IDX 2
static char manufacturer[] = "LEGO Group";
static char serial[] = "123456789ABC ";
static char longname[] = "EV3 brick ";
static struct usb_string strings_dev[3] = {
[STRING_MANUFACTURER_IDX].s = manufacturer,
[STRING_PRODUCT_IDX].s = longname,
[STRING_SERIAL_IDX].s = serial
};
static struct usb_gadget_strings stringtab_dev = {
.language = 0x0409, /* en-us */
.strings = strings_dev,
};
static struct usb_gadget_strings *dev_strings[] = {
&stringtab_dev,
NULL,
};
/*-------------------------------------------------------------------------*/
struct usb_request *alloc_ep_req(struct usb_ep *ep)
{
struct usb_request *req;
req = usb_ep_alloc_request(ep, GFP_ATOMIC);
if (req) {
req->length = buflen;
req->buf = kmalloc(buflen, GFP_ATOMIC);
if (!req->buf) {
usb_ep_free_request(ep, req);
req = NULL;
}
}
return req;
}
void free_ep_req(struct usb_ep *ep, struct usb_request *req)
{
kfree(req->buf);
usb_ep_free_request(ep, req);
}
static void disable_ep(struct usb_composite_dev *cdev, struct usb_ep *ep)
{
int value;
if (ep->driver_data) {
value = usb_ep_disable(ep);
if (value < 0)
DBG(cdev, "disable %s --> %d\n",
ep->name, value);
ep->driver_data = NULL;
}
}
void disable_endpoints(struct usb_composite_dev *cdev,
struct usb_ep *in, struct usb_ep *out)
{
disable_ep(cdev, in);
disable_ep(cdev, out);
}
/*-------------------------------------------------------------------------*/
static struct timer_list autoresume_timer;
static void zero_autoresume(unsigned long _c)
{
struct usb_composite_dev *cdev = (void *)_c;
struct usb_gadget *g = cdev->gadget;
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("zero_autoresume\n\r");
#endif
/* unconfigured devices can't issue wakeups */
if (!cdev->config)
return;
/* Normally the host would be woken up for something
* more significant than just a timer firing; likely
* because of some direct user request.
*/
if (g->speed != USB_SPEED_UNKNOWN) {
int status = usb_gadget_wakeup(g);
INFO(cdev, "%s --> %d\n", __func__, status);
}
}
static void zero_suspend(struct usb_composite_dev *cdev)
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("zero_suspend\n\r");
#endif
if (cdev->gadget->speed == USB_SPEED_UNKNOWN)
return;
if (autoresume) {
mod_timer(&autoresume_timer, jiffies + (HZ * autoresume));
DBG(cdev, "suspend, wakeup in %d seconds\n", autoresume);
} else
DBG(cdev, "%s\n", __func__);
}
static void zero_resume(struct usb_composite_dev *cdev)
{
DBG(cdev, "%s\n", __func__);
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("zero_resume\n\r");
#endif
del_timer(&autoresume_timer);
}
/*-------------------------------------------------------------------------*/
static int msg_bind(struct usb_composite_dev *cdev);
static void msg_bind2(struct usb_composite_dev *cdev);
static int zero_bind(struct usb_composite_dev *cdev)
{
int gcnum;
struct usb_gadget *gadget = cdev->gadget;
int id;
/* Allocate string descriptor numbers ... note that string
* contents can be overridden by the composite_dev glue.
*/
id = usb_string_id(cdev);
if (id < 0)
return id;
strings_dev[STRING_MANUFACTURER_IDX].id = id;
device_desc.iManufacturer = id;
id = usb_string_id(cdev);
if (id < 0)
return id;
strings_dev[STRING_PRODUCT_IDX].id = id;
device_desc.iProduct = id;
id = usb_string_id(cdev);
if (id < 0)
return id;
strings_dev[STRING_SERIAL_IDX].id = id;
device_desc.iSerialNumber = id;
id = msg_bind(cdev);
if (id < 0)
return id;
setup_timer(&autoresume_timer, zero_autoresume, (unsigned long) cdev);
rudolf_add(cdev, autoresume != 0);
gcnum = usb_gadget_controller_number(gadget);
if (gcnum >= 0)
device_desc.bcdDevice = cpu_to_le16(0x0200 + gcnum);
else {
/* gadget zero is so simple (for now, no altsettings) that
* it SHOULD NOT have problems with bulk-capable hardware.
* so just warn about unrcognized controllers -- don't panic.
*
* things like configuration and altsetting numbering
* can need hardware-specific attention though.
*/
pr_warning("%s: controller '%s' not recognized\n",
longname, gadget->name);
device_desc.bcdDevice = cpu_to_le16(0x9999);
}
msg_bind2(cdev);
return 0;
}
static int zero_unbind(struct usb_composite_dev *cdev)
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("zero_unbind\n\r");
#endif
del_timer_sync(&autoresume_timer);
return 0;
}
static struct usb_composite_driver zero_driver = {
.name = "zero",
.dev = &device_desc,
.strings = dev_strings,
.bind = zero_bind,
.unbind = zero_unbind,
.suspend = zero_suspend,
.resume = zero_resume,
};
static int dUsbInit(void)
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("dUsbInit\n\r");
#endif
UsbSpeed.Speed = FULL_SPEED; // default to FULL_SPEED if not connected to a HIGH-SPEED
(*pUsbSpeed).Speed = FULL_SPEED; // HOST. If not connected to HIGH-SPEED we assume we're
// wanting (or at least doing) Daisy Chain
return usb_composite_register(&zero_driver);
}
static void dUsbExit(void)
{
usb_composite_unregister(&zero_driver);
}
// DEVICE1 char device stuff ********************************************************************
static ssize_t Device1Write(struct file *File,const char *Buffer,size_t Count,loff_t *Data)
{
// Write data for the HOST to poll - Stuff sent to the HOST
int BytesWritten = 0;
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
printk("Device1Write - usb_char_in_length = %d\n", usb_char_in_length);
#endif
if (usb_char_in_length == 0) // ready for more
{ // else wait in USER layer
BytesWritten = Count;
copy_from_user(usb_char_buffer_in, Buffer, BytesWritten);
usb_char_in_length = BytesWritten;
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("WR = %d, %d -- ", usb_char_buffer_in[2], usb_char_buffer_in[3]);
#endif
if(USB_DATA_PENDING == input_state)
{
// Already we've a failed tx (HOST part starwing??
input_state = USB_DATA_READY;
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
printk("DATA_PENDING SECOND time and reset!! in Device1Write\n\r");
#endif
}
if(USB_DATA_READY == input_state)
{
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
printk("USB_DATA_READY in Device1Write\n\r");
#endif
input_state = USB_DATA_BUSY;
write_data_to_the_host(save_in_ep, save_in_req);
usb_req_arm(save_in_ep, save_in_req); // new request
}
else
{
input_state = USB_DATA_PENDING;
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
printk("DATA_PENDING in Device1Write\n\r");
#endif
}
}
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("usbdev %d written\n\r", BytesWritten);
#endif
return (BytesWritten); // Zero means USB was not ready yet
}
static ssize_t Device1Read(struct file *File,char *Buffer,size_t Count,loff_t *Offset)
{
// Read the bits'n'bytes from the HOST
int BytesRead = 0;
if (usb_char_out_length > 0) // Something to look at
{
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
printk("Some bytes to READ?\n\r");
#endif
copy_to_user(Buffer, usb_char_buffer_out, Count);
BytesRead = usb_char_out_length;
usb_char_out_length = 0;
}
return (BytesRead);
}
static int Device1Mmap(struct file *filp, struct vm_area_struct *vma)
{
int ret;
ret = remap_pfn_range(vma,vma->vm_start,virt_to_phys((void*)((unsigned long)pUsbSpeed)) >> PAGE_SHIFT,vma->vm_end-vma->vm_start,PAGE_SHARED);
if (ret != 0)
{
ret = -EAGAIN;
}
return (ret);
}
#define FEED_DATA _IOC(_IOC_WRITE, 't', 108, 1024)
static int Device1Ioctl(struct inode *pNode, struct file *File, unsigned int Request, unsigned long Pointer)
{
if (Request != FEED_DATA)
return -EINVAL;
copy_from_user(usb_char_buffer_out,(void*)Pointer,1024);
usb_char_out_length = 1024;
return 0;
}
static const struct file_operations Device1Entries =
{
.owner = THIS_MODULE,
.read = Device1Read,
.write = Device1Write,
.mmap = Device1Mmap,
.ioctl = Device1Ioctl
};
static struct miscdevice Device1 =
{
MISC_DYNAMIC_MINOR,
DEVICE1_NAME,
&Device1Entries
};
static int Device1Init(void)
{
int Result = -1;
UWORD *pTemp;
int i;
Result = misc_register(&Device1);
if (Result)
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk(" %s device register failed\n",DEVICE1_NAME);
#endif
}
else
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk(" %s device register OK\n",DEVICE1_NAME);
#endif
// allocate kernel shared memory for DaisyChain Speed info
if ((kmalloc_ptr = kmalloc((NPAGES + 2) * PAGE_SIZE, GFP_KERNEL)) != NULL)
{
pTemp = (UWORD*)((((unsigned long)kmalloc_ptr) + PAGE_SIZE - 1) & PAGE_MASK);
for (i = 0; i < NPAGES * PAGE_SIZE; i += PAGE_SIZE)
{
SetPageReserved(virt_to_page(((unsigned long)pTemp) + i));
}
pUsbSpeed = (USB_SPEED*)pTemp;
}
dUsbInit();
}
return (Result);
}
static void Device1Exit(void)
{
int i;
UWORD *pTemp = (UWORD*)pUsbSpeed;
dUsbExit();
pUsbSpeed = &UsbSpeedDefault;
for (i = 0; i < NPAGES * PAGE_SIZE; i+= PAGE_SIZE)
{
ClearPageReserved(virt_to_page(((unsigned long)pTemp) + i));
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk(" %s memory page %d unmapped\n",DEVICE1_NAME,i);
#endif
}
kfree(kmalloc_ptr);
misc_deregister(&Device1);
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk(" %s device unregistered\n",DEVICE1_NAME);
#endif
}
// MODULE *********************************************************************
char *HostStr; // Used for HostName - or NOT used at all
char *SerialStr; // Used for Serial number (I.e. BT number)
module_param (HostStr, charp, 0);
module_param (SerialStr, charp, 0);
static int ModuleInit(void)
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("%s Module init started\r\n",MODULE_NAME);
#endif
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("This is DEFAULT NAME: %s\n\r", longname);
#endif
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("\n\rThis is the HostStr: %s\n\r", HostStr);
#endif
strcpy(longname, HostStr);
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("\n\rThis is the INSMODed NAME: %s\n\r", longname);
#endif
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("\n\rThis is the DEFAULT SerialNumber: %s\n\r", serial);
#endif
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("\n\rThis is the SerialStr: %s\n\r", SerialStr);
#endif
strcpy(serial, SerialStr);
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("\n\rThis is the INSMODed SerialNumber (BT mac): %s\n\r", serial);
#endif
Device1Init();
return (0);
}
static void ModuleExit(void)
{
//#define DEBUG
#undef DEBUG
#ifdef DEBUG
printk("%s exit started\n",MODULE_NAME);
#endif
Device1Exit();
}
// MSG
/****************************** Configurations ******************************/
static struct fsg_module_parameters fsg_mod_data = {
.stall = 1
};
FSG_MODULE_PARAMETERS(/* no prefix */, fsg_mod_data);
/****************************** Gadget Bind ******************************/
static void msg_bind2(struct usb_composite_dev *cdev)
{
fsg_common_put(fsg_common);
}
static int msg_bind(struct usb_composite_dev *cdev)
{
/* set up mass storage function */
fsg_common = fsg_common_from_params(0, cdev, &fsg_mod_data);
if (IS_ERR(fsg_common)) {
return PTR_ERR(fsg_common);
}
return 0;
}
static int msg_config(struct usb_configuration *c) {
return fsg_add(c->cdev, c, fsg_common);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,276 +0,0 @@
/*
* USB device controllers have lots of quirks. Use these macros in
* gadget drivers or other code that needs to deal with them, and which
* autoconfigures instead of using early binding to the hardware.
*
* This SHOULD eventually work like the ARM mach_is_*() stuff, driven by
* some config file that gets updated as new hardware is supported.
* (And avoiding all runtime comparisons in typical one-choice configs!)
*
* NOTE: some of these controller drivers may not be available yet.
* Some are available on 2.4 kernels; several are available, but not
* yet pushed in the 2.6 mainline tree.
*/
#ifndef __GADGET_CHIPS_H
#define __GADGET_CHIPS_H
#ifdef CONFIG_USB_GADGET_NET2280
#define gadget_is_net2280(g) !strcmp("net2280", (g)->name)
#else
#define gadget_is_net2280(g) 0
#endif
#ifdef CONFIG_USB_GADGET_AMD5536UDC
#define gadget_is_amd5536udc(g) !strcmp("amd5536udc", (g)->name)
#else
#define gadget_is_amd5536udc(g) 0
#endif
#ifdef CONFIG_USB_GADGET_DUMMY_HCD
#define gadget_is_dummy(g) !strcmp("dummy_udc", (g)->name)
#else
#define gadget_is_dummy(g) 0
#endif
#ifdef CONFIG_USB_GADGET_PXA25X
#define gadget_is_pxa(g) !strcmp("pxa25x_udc", (g)->name)
#else
#define gadget_is_pxa(g) 0
#endif
#ifdef CONFIG_USB_GADGET_GOKU
#define gadget_is_goku(g) !strcmp("goku_udc", (g)->name)
#else
#define gadget_is_goku(g) 0
#endif
/* SH3 UDC -- not yet ported 2.4 --> 2.6 */
#ifdef CONFIG_USB_GADGET_SUPERH
#define gadget_is_sh(g) !strcmp("sh_udc", (g)->name)
#else
#define gadget_is_sh(g) 0
#endif
/* not yet stable on 2.6 (would help "original Zaurus") */
#ifdef CONFIG_USB_GADGET_SA1100
#define gadget_is_sa1100(g) !strcmp("sa1100_udc", (g)->name)
#else
#define gadget_is_sa1100(g) 0
#endif
#ifdef CONFIG_USB_GADGET_LH7A40X
#define gadget_is_lh7a40x(g) !strcmp("lh7a40x_udc", (g)->name)
#else
#define gadget_is_lh7a40x(g) 0
#endif
/* handhelds.org tree (?) */
#ifdef CONFIG_USB_GADGET_MQ11XX
#define gadget_is_mq11xx(g) !strcmp("mq11xx_udc", (g)->name)
#else
#define gadget_is_mq11xx(g) 0
#endif
#ifdef CONFIG_USB_GADGET_OMAP
#define gadget_is_omap(g) !strcmp("omap_udc", (g)->name)
#else
#define gadget_is_omap(g) 0
#endif
/* not yet ported 2.4 --> 2.6 */
#ifdef CONFIG_USB_GADGET_N9604
#define gadget_is_n9604(g) !strcmp("n9604_udc", (g)->name)
#else
#define gadget_is_n9604(g) 0
#endif
/* various unstable versions available */
#ifdef CONFIG_USB_GADGET_PXA27X
#define gadget_is_pxa27x(g) !strcmp("pxa27x_udc", (g)->name)
#else
#define gadget_is_pxa27x(g) 0
#endif
#ifdef CONFIG_USB_GADGET_ATMEL_USBA
#define gadget_is_atmel_usba(g) !strcmp("atmel_usba_udc", (g)->name)
#else
#define gadget_is_atmel_usba(g) 0
#endif
#ifdef CONFIG_USB_GADGET_S3C2410
#define gadget_is_s3c2410(g) !strcmp("s3c2410_udc", (g)->name)
#else
#define gadget_is_s3c2410(g) 0
#endif
#ifdef CONFIG_USB_GADGET_AT91
#define gadget_is_at91(g) !strcmp("at91_udc", (g)->name)
#else
#define gadget_is_at91(g) 0
#endif
#ifdef CONFIG_USB_GADGET_IMX
#define gadget_is_imx(g) !strcmp("imx_udc", (g)->name)
#else
#define gadget_is_imx(g) 0
#endif
#ifdef CONFIG_USB_GADGET_FSL_USB2
#define gadget_is_fsl_usb2(g) !strcmp("fsl-usb2-udc", (g)->name)
#else
#define gadget_is_fsl_usb2(g) 0
#endif
/* Mentor high speed function controller */
/* from Montavista kernel (?) */
#ifdef CONFIG_USB_GADGET_MUSBHSFC
#define gadget_is_musbhsfc(g) !strcmp("musbhsfc_udc", (g)->name)
#else
#define gadget_is_musbhsfc(g) 0
#endif
/* Mentor high speed "dual role" controller, in peripheral role */
#ifdef CONFIG_USB_GADGET_MUSB_HDRC
#define gadget_is_musbhdrc(g) !strcmp("musb_hdrc", (g)->name)
#else
#define gadget_is_musbhdrc(g) 0
#endif
#ifdef CONFIG_USB_GADGET_LANGWELL
#define gadget_is_langwell(g) (!strcmp("langwell_udc", (g)->name))
#else
#define gadget_is_langwell(g) 0
#endif
/* from Montavista kernel (?) */
#ifdef CONFIG_USB_GADGET_MPC8272
#define gadget_is_mpc8272(g) !strcmp("mpc8272_udc", (g)->name)
#else
#define gadget_is_mpc8272(g) 0
#endif
#ifdef CONFIG_USB_GADGET_M66592
#define gadget_is_m66592(g) !strcmp("m66592_udc", (g)->name)
#else
#define gadget_is_m66592(g) 0
#endif
/* Freescale CPM/QE UDC SUPPORT */
#ifdef CONFIG_USB_GADGET_FSL_QE
#define gadget_is_fsl_qe(g) !strcmp("fsl_qe_udc", (g)->name)
#else
#define gadget_is_fsl_qe(g) 0
#endif
#ifdef CONFIG_USB_GADGET_CI13XXX
#define gadget_is_ci13xxx(g) (!strcmp("ci13xxx_udc", (g)->name))
#else
#define gadget_is_ci13xxx(g) 0
#endif
// CONFIG_USB_GADGET_SX2
// CONFIG_USB_GADGET_AU1X00
// ...
#ifdef CONFIG_USB_GADGET_R8A66597
#define gadget_is_r8a66597(g) !strcmp("r8a66597_udc", (g)->name)
#else
#define gadget_is_r8a66597(g) 0
#endif
/**
* usb_gadget_controller_number - support bcdDevice id convention
* @gadget: the controller being driven
*
* Return a 2-digit BCD value associated with the peripheral controller,
* suitable for use as part of a bcdDevice value, or a negative error code.
*
* NOTE: this convention is purely optional, and has no meaning in terms of
* any USB specification. If you want to use a different convention in your
* gadget driver firmware -- maybe a more formal revision ID -- feel free.
*
* Hosts see these bcdDevice numbers, and are allowed (but not encouraged!)
* to change their behavior accordingly. For example it might help avoiding
* some chip bug.
*/
static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
{
if (gadget_is_net2280(gadget))
return 0x01;
else if (gadget_is_dummy(gadget))
return 0x02;
else if (gadget_is_pxa(gadget))
return 0x03;
else if (gadget_is_sh(gadget))
return 0x04;
else if (gadget_is_sa1100(gadget))
return 0x05;
else if (gadget_is_goku(gadget))
return 0x06;
else if (gadget_is_mq11xx(gadget))
return 0x07;
else if (gadget_is_omap(gadget))
return 0x08;
else if (gadget_is_lh7a40x(gadget))
return 0x09;
else if (gadget_is_n9604(gadget))
return 0x10;
else if (gadget_is_pxa27x(gadget))
return 0x11;
else if (gadget_is_s3c2410(gadget))
return 0x12;
else if (gadget_is_at91(gadget))
return 0x13;
else if (gadget_is_imx(gadget))
return 0x14;
else if (gadget_is_musbhsfc(gadget))
return 0x15;
else if (gadget_is_musbhdrc(gadget))
return 0x16;
else if (gadget_is_mpc8272(gadget))
return 0x17;
else if (gadget_is_atmel_usba(gadget))
return 0x18;
else if (gadget_is_fsl_usb2(gadget))
return 0x19;
else if (gadget_is_amd5536udc(gadget))
return 0x20;
else if (gadget_is_m66592(gadget))
return 0x21;
else if (gadget_is_fsl_qe(gadget))
return 0x22;
else if (gadget_is_ci13xxx(gadget))
return 0x23;
else if (gadget_is_langwell(gadget))
return 0x24;
else if (gadget_is_r8a66597(gadget))
return 0x25;
return -ENOENT;
}
/**
* gadget_supports_altsettings - return true if altsettings work
* @gadget: the gadget in question
*/
static inline bool gadget_supports_altsettings(struct usb_gadget *gadget)
{
/* PXA 21x/25x/26x has no altsettings at all */
if (gadget_is_pxa(gadget))
return false;
/* PXA 27x and 3xx have *broken* altsetting support */
if (gadget_is_pxa27x(gadget))
return false;
/* SH3 hardware just doesn't do altsettings */
if (gadget_is_sh(gadget))
return false;
/* Everything else is *presumably* fine ... */
return true;
}
#endif /* __GADGET_CHIPS_H */

View File

@ -1,249 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef AM1808_H_
#define AM1808_H_
#ifndef PCASM
#include <mach/da8xx.h>
#else
#define __iomem
#endif
enum
{
GP0_0,GP0_1,GP0_2,GP0_3,GP0_4,GP0_5,GP0_6,GP0_7,GP0_8,GP0_9,GP0_10,GP0_11,GP0_12,GP0_13,GP0_14,GP0_15,
GP1_0,GP1_1,GP1_2,GP1_3,GP1_4,GP1_5,GP1_6,GP1_7,GP1_8,GP1_9,GP1_10,GP1_11,GP1_12,GP1_13,GP1_14,GP1_15,
GP2_0,GP2_1,GP2_2,GP2_3,GP2_4,GP2_5,GP2_6,GP2_7,GP2_8,GP2_9,GP2_10,GP2_11,GP2_12,GP2_13,GP2_14,GP2_15,
GP3_0,GP3_1,GP3_2,GP3_3,GP3_4,GP3_5,GP3_6,GP3_7,GP3_8,GP3_9,GP3_10,GP3_11,GP3_12,GP3_13,GP3_14,GP3_15,
GP4_0,GP4_1,GP4_2,GP4_3,GP4_4,GP4_5,GP4_6,GP4_7,GP4_8,GP4_9,GP4_10,GP4_11,GP4_12,GP4_13,GP4_14,GP4_15,
GP5_0,GP5_1,GP5_2,GP5_3,GP5_4,GP5_5,GP5_6,GP5_7,GP5_8,GP5_9,GP5_10,GP5_11,GP5_12,GP5_13,GP5_14,GP5_15,
GP6_0,GP6_1,GP6_2,GP6_3,GP6_4,GP6_5,GP6_6,GP6_7,GP6_8,GP6_9,GP6_10,GP6_11,GP6_12,GP6_13,GP6_14,GP6_15,
GP7_0,GP7_1,GP7_2,GP7_3,GP7_4,GP7_5,GP7_6,GP7_7,GP7_8,GP7_9,GP7_10,GP7_11,GP7_12,GP7_13,GP7_14,GP7_15,
GP8_0,GP8_1,GP8_2,GP8_3,GP8_4,GP8_5,GP8_6,GP8_7,GP8_8,GP8_9,GP8_10,GP8_11,GP8_12,GP8_13,GP8_14,GP8_15,
NO_OF_GPIOS,
UART0_TXD,UART0_RXD,UART1_TXD,UART1_RXD,
SPI0_MOSI,SPI0_MISO,SPI0_SCL,SPI0_CS,
SPI1_MOSI,SPI1_MISO,SPI1_SCL,SPI1_CS,
EPWM1A,EPWM1B,APWM0,APWM1,EPWM0B,AXR3,AXR4
};
typedef struct
{
int Pin;
u16 MuxReg;
u32 Mask;
u32 Mode;
}
MRM;
MRM MuxRegMap[] =
{ // Pin MuxReg Mask Mode
{ GP0_1 , 1, 0xF0FFFFFF, 0x08000000 },
{ GP0_2 , 1, 0xFF0FFFFF, 0x00800000 },
{ GP0_3 , 1, 0xFFF0FFFF, 0x00080000 },
{ GP0_4 , 1, 0xFFFF0FFF, 0x00008000 },
{ GP0_5 , 1, 0xFFFFF0FF, 0x00000800 },
{ GP0_6 , 1, 0xFFFFFF0F, 0x00000080 },
{ GP0_7 , 1, 0xFFFFFFF0, 0x00000008 },
{ GP0_11, 0, 0xFFF0FFFF, 0x00080000 },
{ GP0_12, 0, 0xFFFF0FFF, 0x00008000 },
{ GP0_13, 0, 0xFFFFF0FF, 0x00000800 },
{ GP0_14, 0, 0xFFFFFF0F, 0x00000080 },
{ GP0_15, 0, 0xFFFFFFF0, 0x00000008 },
{ GP1_0 , 4, 0x0FFFFFFF, 0x80000000 },
{ GP1_8 , 3, 0xFFFFFFF0, 0x00000004 },
{ GP1_9, 2, 0xF0FFFFFF, 0x04000000 },
{ GP1_10, 2, 0xFF0FFFFF, 0x00400000 },
{ GP1_11, 2, 0xFFF0FFFF, 0x00040000 },
{ GP1_12, 2, 0xFFFF0FFF, 0x00004000 },
{ GP1_13, 2, 0xFFFFF0FF, 0x00000400 },
{ GP1_14, 2, 0xFFFFFF0F, 0x00000040 },
{ GP1_15, 2, 0xFFFFFFF0, 0x00000008 },
{ GP2_0, 6, 0x0FFFFFFF, 0x80000000 },
{ GP2_1, 6, 0xF0FFFFFF, 0x08000000 },
{ GP2_2, 6, 0xFF0FFFFF, 0x00800000 },
{ GP2_3, 6, 0xFFF0FFFF, 0x00080000 },
{ GP2_4, 6, 0xFFFF0FFF, 0x00008000 },
{ GP2_5, 6, 0xFFFFF0FF, 0x00000800 },
{ GP2_6, 6, 0xFFFFFF0F, 0x00000080 },
{ GP2_7, 6, 0xFFFFFFF0, 0x00000008 },
{ GP2_8, 5, 0x0FFFFFFF, 0x80000000 },
{ GP2_9, 5, 0xF0FFFFFF, 0x08000000 },
{ GP2_10, 5, 0xFF0FFFFF, 0x00800000 },
{ GP2_11, 5, 0xFFF0FFFF, 0x00080000 },
{ GP2_12, 5, 0xFFFF0FFF, 0x00008000 },
{ GP2_13, 5, 0xFFFFF0FF, 0x00000800 },
{ GP3_0, 8, 0x0FFFFFFF, 0x80000000 },
{ GP3_1 , 8, 0xF0FFFFFF, 0x08000000 },
{ GP3_2, 8, 0xFF0FFFFF, 0x00800000 },
{ GP3_3, 8, 0xFFF0FFFF, 0x00080000 },
{ GP3_4, 8, 0xFFFF0FFF, 0x00008000 },
{ GP3_5, 8, 0xFFFFF0FF, 0x00000800 },
{ GP3_6, 8, 0xFFFFFF0F, 0x00000080 },
{ GP3_7, 8, 0xFFFFFFF0, 0x00000008 },
{ GP3_8, 7, 0x0FFFFFFF, 0x80000000 },
{ GP3_9, 7, 0xF0FFFFFF, 0x08000000 },
{ GP3_10, 7, 0xFF0FFFFF, 0x00800000 },
{ GP3_11, 7, 0xFFF0FFFF, 0x00080000 },
{ GP3_12, 7, 0xFFFF0FFF, 0x00008000 },
{ GP3_13, 7, 0xFFFFF0FF, 0x00000800 },
{ GP3_14, 7, 0xFFFFFF0F, 0x00000080 },
{ GP3_15, 7, 0xFFFFFFF0, 0x00000008 },
{ GP4_1, 10, 0xF0FFFFFF, 0x08000000 },
{ GP4_8, 9, 0x0FFFFFFF, 0x80000000 },
{ GP4_9, 9, 0xF0FFFFFF, 0x08000000 },
{ GP4_10, 9, 0xFF0FFFFF, 0x00800000 },
{ GP4_12, 9, 0xFFFF0FFF, 0x00008000 },
{ GP4_14, 9, 0xFFFFFF0F, 0x00000080 },
{ GP5_0, 12, 0x0FFFFFFF, 0x80000000 },
{ GP5_1, 12, 0xF0FFFFFF, 0x08000000 },
{ GP5_2, 12, 0xFF0FFFFF, 0x00800000 },
{ GP5_3, 12, 0xFFF0FFFF, 0x00080000 },
{ GP5_4, 12, 0xFFFF0FFF, 0x00008000 },
{ GP5_5, 12, 0xFFFFF0FF, 0x00000800 },
{ GP5_6, 12, 0xFFFFFF0F, 0x00000080 },
{ GP5_7, 12, 0xFFFFFFF0, 0x00000008 },
{ GP5_8, 11, 0x0FFFFFFF, 0x80000000 },
{ GP5_9, 11, 0xF0FFFFFF, 0x08000000 },
{ GP5_10, 11, 0xFF0FFFFF, 0x00800000 },
{ GP5_11, 11, 0xFFF0FFFF, 0x00080000 },
{ GP5_12, 11, 0xFFFF0FFF, 0x00008000 },
{ GP5_13, 11, 0xFFFFF0FF, 0x00000800 },
{ GP5_14, 11, 0xFFFFFF0F, 0x00000080 },
{ GP5_15, 11, 0xFFFFFFF0, 0x00000008 },
{ GP6_0 , 19, 0xF0FFFFFF, 0x08000000 },
{ GP6_1, 19, 0xFF0FFFFF, 0x00800000 },
{ GP6_2, 19, 0xFFF0FFFF, 0x00080000 },
{ GP6_3, 19, 0xFFFF0FFF, 0x00008000 },
{ GP6_4, 19, 0xFFFFF0FF, 0x00000800 },
{ GP6_5, 16, 0xFFFFFF0F, 0x00000080 },
{ GP6_6, 14, 0xFFFFFF0F, 0x00000080 },
{ GP6_7, 14, 0xFFFFFFF0, 0x00000008 },
{ GP6_8, 13, 0x0FFFFFFF, 0x80000000 },
{ GP6_9, 13, 0xF0FFFFFF, 0x08000000 },
{ GP6_10, 13, 0xFF0FFFFF, 0x00800000 },
{ GP6_11, 13, 0xFFF0FFFF, 0x00080000 },
{ GP6_12, 13, 0xFFFF0FFF, 0x00008000 },
{ GP6_13, 13, 0xFFFFF0FF, 0x00000800 },
{ GP6_14, 13, 0xFFFFFF0F, 0x00000080 },
{ GP6_15, 13, 0xFFFFFFF0, 0x00000008 },
{ GP7_4, 17, 0xFF0FFFFF, 0x00800000 },
{ GP7_8, 17, 0xFFFFFF0F, 0x00000080 },
{ GP7_9, 17, 0xFFFFFFF0, 0x00000008 },
{ GP7_10, 16, 0x0FFFFFFF, 0x80000000 },
{ GP7_11, 16, 0xF0FFFFFF, 0x08000000 },
{ GP7_12, 16, 0xFF0FFFFF, 0x00800000 },
{ GP7_13, 16, 0xFFF0FFFF, 0x00080000 },
{ GP7_14, 16, 0xFFFF0FFF, 0x00008000 },
{ GP7_15, 16, 0xFFFFF0FF, 0x00000800 },
{ GP8_2 , 3 , 0xF0FFFFFF, 0x04000000 },
{ GP8_3 , 3 , 0xFF0FFFFF, 0x00400000 },
{ GP8_5 , 3 , 0xFFFF0FFF, 0x00004000 },
{ GP8_6 , 3 , 0xFFFFF0FF, 0x00000400 },
{ GP8_8 , 19, 0xFFFFFF0F, 0x00000080 },
{ GP8_9 , 19, 0xFFFFFFF0, 0x00000008 },
{ GP8_10, 18, 0x0FFFFFFF, 0x80000000 },
{ GP8_11, 18, 0xF0FFFFFF, 0x08000000 },
{ GP8_12, 18, 0xFF0FFFFF, 0x00800000 },
{ GP8_13, 18, 0xFFF0FFFF, 0x00080000 },
{ GP8_14, 18, 0xFFFF0FFF, 0x00008000 },
{ GP8_15, 18, 0xFFFFF0FF, 0x00000800 },
{ UART0_TXD, 3, 0xFF0FFFFF, 0x00200000 },
{ UART0_RXD, 3, 0xFFF0FFFF, 0x00020000 },
{ UART1_TXD, 4, 0x0FFFFFFF, 0x20000000 },
{ UART1_RXD, 4, 0xF0FFFFFF, 0x02000000 },
{ SPI0_MOSI, 3, 0xFFFF0FFF, 0x00001000 },
{ SPI0_MISO, 3, 0xFFFFF0FF, 0x00000100 },
{ SPI0_SCL, 3, 0xFFFFFFF0, 0x00000001 },
{ SPI0_CS, 3, 0xF0FFFFFF, 0x01000000 },
{ SPI1_MOSI, 5, 0xFF0FFFFF, 0x00100000 },
{ SPI1_MISO, 5, 0xFFF0FFFF, 0x00010000 },
{ SPI1_SCL, 5, 0xFFFFF0FF, 0x00000100 },
{ SPI1_CS, 5, 0xFFFF0FFF, 0x00008000 },
{ EPWM1A, 5, 0xFFFFFFF0, 0x00000002 },
{ EPWM1B, 5, 0xFFFFFF0F, 0x00000020 },
{ APWM0, 2, 0x0FFFFFFF, 0x20000000 },
{ APWM1, 1, 0x0FFFFFFF, 0x40000000 },
{ EPWM0B, 3, 0xFFFFFF0F, 0x00000020 },
{ AXR3, 2, 0xFFF0FFFF, 0x00010000 },
{ AXR4, 2, 0xFFFF0FFF, 0x00001000 },
{-1 }
};
typedef struct gpio_controller *__iomem GPIOC;
typedef struct
{
int Pin; // GPIO pin number
GPIOC pGpio; // GPIO bank base address
u32 Mask; // GPIO pin mask
}
INPIN;
#define REGUnlock {\
iowrite32(0x83E70B13,da8xx_syscfg0_base + 0x38);\
iowrite32(0x95A4F1E0,da8xx_syscfg0_base + 0x3C);\
}
#define REGLock {\
iowrite32(0x00000000,da8xx_syscfg0_base + 0x38);\
iowrite32(0x00000000,da8xx_syscfg0_base + 0x3C);\
}
#else
extern MRM MuxRegMap[];
#endif /* AM1808_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,81 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef C_BRANCH_H_
#define C_BRANCH_H_
void cBranchJr(void);
void cBranchJrFalse(void);
void cBranchJrTrue(void);
void cBranchJrNan(void);
void cBranchJrLt8(void);
void cBranchJrLt16(void);
void cBranchJrLt32(void);
void cBranchJrLtF(void);
void cBranchJrGt8(void);
void cBranchJrGt16(void);
void cBranchJrGt32(void);
void cBranchJrGtF(void);
void cBranchJrLtEq8(void);
void cBranchJrLtEq16(void);
void cBranchJrLtEq32(void);
void cBranchJrLtEqF(void);
void cBranchJrGtEq8(void);
void cBranchJrGtEq16(void);
void cBranchJrGtEq32(void);
void cBranchJrGtEqF(void);
void cBranchJrEq8(void);
void cBranchJrEq16(void);
void cBranchJrEq32(void);
void cBranchJrEqF(void);
void cBranchJrNEq8(void);
void cBranchJrNEq16(void);
void cBranchJrNEq32(void);
void cBranchJrNEqF(void);
#endif /* C_BRANCH_H_ */

View File

@ -1,81 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef C_COMPARE_H_
#define C_COMPARE_H_
void cCompareLt8(void);
void cCompareLt16(void);
void cCompareLt32(void);
void cCompareLtF(void);
void cCompareGt8(void);
void cCompareGt16(void);
void cCompareGt32(void);
void cCompareGtF(void);
void cCompareEq8(void);
void cCompareEq16(void);
void cCompareEq32(void);
void cCompareEqF(void);
void cCompareNEq8(void);
void cCompareNEq16(void);
void cCompareNEq32(void);
void cCompareNEqF(void);
void cCompareLtEq8(void);
void cCompareLtEq16(void);
void cCompareLtEq32(void);
void cCompareLtEqF(void);
void cCompareGtEq8(void);
void cCompareGtEq16(void);
void cCompareGtEq32(void);
void cCompareGtEqF(void);
void cCompareSelect8(void);
void cCompareSelect16(void);
void cCompareSelect32(void);
void cCompareSelectF(void);
#endif /* C_COMPARE_H_ */

View File

@ -1,88 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef C_MATH_H_
#define C_MATH_H_
#define DegToRad(D) (D * 0.0174532925)
#define RadToDeg(R) (R * 57.2957795)
void cMathAdd8(void);
void cMathAdd16(void);
void cMathAdd32(void);
void cMathAddF(void);
void cMathSub8(void);
void cMathSub16(void);
void cMathSub32(void);
void cMathSubF(void);
void cMathMul8(void);
void cMathMul16(void);
void cMathMul32(void);
void cMathMulF(void);
void cMathDiv8(void);
void cMathDiv16(void);
void cMathDiv32(void);
void cMathDivF(void);
void cMathOr8(void);
void cMathOr16(void);
void cMathOr32(void);
void cMathAnd8(void);
void cMathAnd16(void);
void cMathAnd32(void);
void cMathXor8(void);
void cMathXor16(void);
void cMathXor32(void);
void cMathRl8(void);
void cMathRl16(void);
void cMathRl32(void);
void cMath(void);
#endif /* C_MATH_H_ */

View File

@ -1,76 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef C_MOVE_H_
#define C_MOVE_H_
void cMove8to8(void);
void cMove8to16(void);
void cMove8to32(void);
void cMove8toF(void);
void cMove16to8(void);
void cMove16to16(void);
void cMove16to32(void);
void cMove16toF(void);
void cMove32to8(void);
void cMove32to16(void);
void cMove32to32(void);
void cMove32toF(void);
void cMoveFto8(void);
void cMoveFto16(void);
void cMoveFto32(void);
void cMoveFtoF(void);
void cMoveInitBytes(void);
void cMoveRead8(void);
void cMoveRead16(void);
void cMoveRead32(void);
void cMoveReadF(void);
void cMoveWrite8(void);
void cMoveWrite16(void);
void cMoveWrite32(void);
void cMoveWriteF(void);
#endif /* C_MOVE_H_ */

View File

@ -1,38 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef C_TIMER_H_
#define C_TIMER_H_
#if (HARDWARE != SIMULATION)
ULONG cTimerGetuS(void);
ULONG cTimerGetmS(void);
#endif
void cTimerWait(void);
void cTimerReady(void);
void cTimerRead(void);
void cTimerReaduS(void);
#endif /* C_TIMER_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,195 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* As a special exception, if other files instantiate templates or use macros or
* inline functions from this file, or you compile this file and link it with
* other works to produce a work based on this file, this file does not by itself
* cause the resulting work to be covered by the GNU General Public License.
* However the source code for this file must still be made available in accordance
* with section (3) of the GNU General Public License.
*
*/
#ifndef LMSTYPES_H_
#define LMSTYPES_H_
// BASIC DATA TYPES
#ifndef LEGO_SIMULATION
typedef unsigned char UBYTE; //!< Basic Type used to symbolise 8 bit unsigned values
typedef unsigned short UWORD; //!< Basic Type used to symbolise 16 bit unsigned values
typedef unsigned int ULONG; //!< Basic Type used to symbolise 32 bit unsigned values
typedef signed char SBYTE; //!< Basic Type used to symbolise 8 bit signed values
typedef signed short SWORD; //!< Basic Type used to symbolise 16 bit signed values
typedef signed int SLONG; //!< Basic Type used to symbolise 32 bit signed values
typedef float FLOAT; //!< Basic Type used to symbolise 32 bit floating point values
#define LFILE FILE
#else
#include <Base/BasicTypes.h>
#include <VMCalls.h>
typedef LEGO::UInt8 UBYTE; //!< Basic Type used to symbolise 8 bit unsigned values
typedef LEGO::UInt16 UWORD; //!< Basic Type used to symbolise 16 bit unsigned values
typedef unsigned long ULONG; //!< Basic Type used to symbolise 32 bit unsigned values
typedef LEGO::Int8 SBYTE; //!< Basic Type used to symbolise 8 bit signed values
typedef LEGO::Int16 SWORD; //!< Basic Type used to symbolise 16 bit signed values
typedef LEGO::Int32 SLONG; //!< Basic Type used to symbolise 32 bit signed values
typedef LEGO::Real32 FLOAT; //!< Basic Type used to symbolise 32 bit floating point values
#endif
// VM DATA TYPES
typedef SBYTE DATA8; //!< VM Type for 1 byte signed value
typedef SWORD DATA16; //!< VM Type for 2 byte signed value
typedef SLONG DATA32; //!< VM Type for 4 byte signed value
typedef FLOAT DATAF; //!< VM Type for 4 byte floating point value
// VM VARIABLE TYPES
typedef UBYTE VARDATA; //!< Variable base type
typedef UBYTE IMGDATA; //!< Image base type
typedef UWORD PRGID; //!< Program id type
typedef UWORD OBJID; //!< Object id type
typedef IMGDATA* IP; //!< Instruction pointer type
typedef VARDATA* LP; //!< Local variable pointer type
typedef VARDATA* GP; //!< global variable pointer type
typedef ULONG IMINDEX; //!< ImageData index type
typedef ULONG GBINDEX; //!< GlobalBytes index type
typedef ULONG LBINDEX; //!< LocalBytes index type
typedef UWORD TRIGGER; //!< TriggerCount type
typedef UBYTE PARS; //!< NoOfParameters type
typedef SLONG IMOFFS; //!< ImageData offset type
typedef DATA16 HANDLER; //!< Memory list index
/*! \page imagelayout Image Layout
* The image consists of three different components in this fixed order: imageheader, objectheaders and byte codes.
*
* The imageheader tells something about image version, filesize, no of objectheaders (objects) and no of global variable bytes.
*
*
* Objectheaders contains different informations depending on the nature of the object:
*
*- The VMTHREAD object (former TBC_TOPVI) \n
* - OffsetToInstructions tells were to find the corresponding byte codes (offset from image start) \n
* - OwnerObjectId must be zero \n
* - TriggerCount is used but must be zero \n
* - LocalBytes describes the number of bytes for local variables \n
*
*- The SUBCALL object (former TBC_VI and TBC_VI_ALIAS) \n
* - OffsetToInstructions tells were to find the corresponding byte codes (if alias this is equal to mother object) \n
* - OwnerObjectId must be zero \n
* - TriggerCount is used and must be one \n
* - LocalBytes describes the number of bytes for local variables \n
*
*- The BLOCK object (former CLUMP) \n
* - OffsetToInstructions tells were to find the corresponding byte codes (offset from image start) \n
* - OwnerObjectId is equal to object id it belongs to (not equal to zero) \n
* - TriggerCount is used to determine how many triggers needed before the BLOCK object is activated \n
* - LocalBytes must be zero (locals are defined in the owner object) \n
*
* Byte codes are described in a different section.
*
* Little Endian are used (addresses and data are represented with LSB on lowest address and MSB on highest address).
*
* Offset to instructions is number of bytes from start of image to start of object instructions.
*
* Index to global variables are byte based and counted from start of globals (zero based).
*
* Index to local variables are byte based and counted from start of object locals (zero based).
*
* Object ID's is not zero based - First object (VMTHEAD) is named 1.
*
*/
/*! \page imagelayout
*
* FILE layout (aligned)
*
*- IMGHEAD (aligned)
* - Sign (4 bytes)
* - ImageSize (4 bytes)
* - VersionInfo (2 bytes)
* - NumberOfObjects (2 bytes)
* - GlobalBytes (4 bytes)
*/
/*! \struct IMGHEAD
* Image header
*/
typedef struct
{
UBYTE Sign[4]; //!< Place holder for the file type identifier
IMINDEX ImageSize; //!< Image size
UWORD VersionInfo; //!< Version identifier
OBJID NumberOfObjects; //!< Total number of objects in image
GBINDEX GlobalBytes; //!< Number of bytes to allocate for global variables
}
IMGHEAD;
/*! \page imagelayout
*
*- OBJHEAD (aligned)
* - OffsetToInstructions (4 bytes)
* - OwnerObjectId (2 bytes)
* - TriggerCount (2 bytes)
* - LocalBytes (4 bytes)
*
*/
/*! \struct OBJHEAD
* Object header used for all types of objects (VMTHREAD, SUBCALL, BLOCK and ALIAS)
*/
typedef struct // Object header
{
IP OffsetToInstructions; //!< Offset to instructions from image start
OBJID OwnerObjectId; //!< Used by BLOCK's to hold the owner id
TRIGGER TriggerCount; //!< Used to determine how many triggers needed before the BLOCK object is activated
LBINDEX LocalBytes; //!< Number of bytes to allocate for local variables
}
OBJHEAD;
/*! \struct LABEL
* Label data hold information used for labels
*/
typedef struct
{
IMINDEX Addr; //!< Offset to breakpoint address from image start
}
LABEL;
#endif /* LMSTYPES_H_ */

View File

@ -1,56 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef VALIDATE_H_
#define VALIDATE_H_
RESULT cValidateInit(void);
RESULT cValidateExit(void);
RESULT cValidateDisassemble(IP pI,IMINDEX *pIndex,LABEL *pLabel);
RESULT cValidateProgram(PRGID PrgId,IP pI,LABEL *pLabel,DATA8 Disassemble);
typedef struct
{
//*****************************************************************************
// Validate Global variables
//*****************************************************************************
int Row;
IMINDEX ValidateErrorIndex;
}
VALIDATE_GLOBALS;
#ifndef LEGO_SIMULATION
extern VALIDATE_GLOBALS ValidateInstance;
#else
extern VALIDATE_GLOBALS * gValidateInstance;
#define ValidateInstance (*gValidateInstance)
void setValidateInstance(VALIDATE_GLOBALS * _Instance);
VALIDATE_GLOBALS * getValidateInstance();
#endif
#endif /* VALIDATE_H_ */

View File

@ -1,779 +0,0 @@
/*
* storage_common.c -- Common definitions for mass storage functionality
*
* Copyright (C) 2003-2008 Alan Stern
* Copyeight (C) 2009 Samsung Electronics
* Author: Michal Nazarewicz (m.nazarewicz@samsung.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* This file requires the following identifiers used in USB strings to
* be defined (each of type pointer to char):
* - fsg_string_manufacturer -- name of the manufacturer
* - fsg_string_product -- name of the product
* - fsg_string_serial -- product's serial
* - fsg_string_config -- name of the configuration
* - fsg_string_interface -- name of the interface
* The first four are only needed when FSG_DESCRIPTORS_DEVICE_STRINGS
* macro is defined prior to including this file.
*/
/*
* When FSG_NO_INTR_EP is defined fsg_fs_intr_in_desc and
* fsg_hs_intr_in_desc objects as well as
* FSG_FS_FUNCTION_PRE_EP_ENTRIES and FSG_HS_FUNCTION_PRE_EP_ENTRIES
* macros are not defined.
*
* When FSG_NO_DEVICE_STRINGS is defined FSG_STRING_MANUFACTURER,
* FSG_STRING_PRODUCT, FSG_STRING_SERIAL and FSG_STRING_CONFIG are not
* defined (as well as corresponding entries in string tables are
* missing) and FSG_STRING_INTERFACE has value of zero.
*
* When FSG_NO_OTG is defined fsg_otg_desc won't be defined.
*/
/*
* When FSG_BUFFHD_STATIC_BUFFER is defined when this file is included
* the fsg_buffhd structure's buf field will be an array of FSG_BUFLEN
* characters rather then a pointer to void.
*/
#include <asm/unaligned.h>
/* Thanks to NetChip Technologies for donating this product ID.
*
* DO NOT REUSE THESE IDs with any other driver!! Ever!!
* Instead: allocate your own, using normal USB-IF procedures. */
#define FSG_VENDOR_ID 0x0525 /* NetChip */
#define FSG_PRODUCT_ID 0xa4a5 /* Linux-USB File-backed Storage Gadget */
/*-------------------------------------------------------------------------*/
#ifndef DEBUG
#undef VERBOSE_DEBUG
#undef DUMP_MSGS
#endif /* !DEBUG */
#ifdef VERBOSE_DEBUG
#define VLDBG LDBG
#else
#define VLDBG(lun, fmt, args...) do { } while (0)
#endif /* VERBOSE_DEBUG */
#define LDBG(lun, fmt, args...) dev_dbg (&(lun)->dev, fmt, ## args)
#define LERROR(lun, fmt, args...) dev_err (&(lun)->dev, fmt, ## args)
#define LWARN(lun, fmt, args...) dev_warn(&(lun)->dev, fmt, ## args)
#define LINFO(lun, fmt, args...) dev_info(&(lun)->dev, fmt, ## args)
/* Keep those macros in sync with thos in
* include/linux/ubs/composite.h or else GCC will complain. If they
* are identical (the same names of arguments, white spaces in the
* same places) GCC will allow redefinition otherwise (even if some
* white space is removed or added) warning will be issued. No
* checking if those symbols is defined is performed because warning
* is desired when those macros were defined by someone else to mean
* something else. */
#define DBG(d, fmt, args...) dev_dbg(&(d)->gadget->dev , fmt , ## args)
#define VDBG(d, fmt, args...) dev_vdbg(&(d)->gadget->dev , fmt , ## args)
#define ERROR(d, fmt, args...) dev_err(&(d)->gadget->dev , fmt , ## args)
#define WARNING(d, fmt, args...) dev_warn(&(d)->gadget->dev , fmt , ## args)
#define INFO(d, fmt, args...) dev_info(&(d)->gadget->dev , fmt , ## args)
#ifdef DUMP_MSGS
# define dump_msg(fsg, /* const char * */ label, \
/* const u8 * */ buf, /* unsigned */ length) do { \
if (length < 512) { \
DBG(fsg, "%s, length %u:\n", label, length); \
print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, \
16, 1, buf, length, 0); \
} \
} while (0)
# define dump_cdb(fsg) do { } while (0)
#else
# define dump_msg(fsg, /* const char * */ label, \
/* const u8 * */ buf, /* unsigned */ length) do { } while (0)
# ifdef VERBOSE_DEBUG
# define dump_cdb(fsg) \
print_hex_dump(KERN_DEBUG, "SCSI CDB: ", DUMP_PREFIX_NONE, \
16, 1, (fsg)->cmnd, (fsg)->cmnd_size, 0) \
# else
# define dump_cdb(fsg) do { } while (0)
# endif /* VERBOSE_DEBUG */
#endif /* DUMP_MSGS */
/*-------------------------------------------------------------------------*/
/* SCSI device types */
#define TYPE_DISK 0x00
#define TYPE_CDROM 0x05
/* USB protocol value = the transport method */
#define USB_PR_CBI 0x00 /* Control/Bulk/Interrupt */
#define USB_PR_CB 0x01 /* Control/Bulk w/o interrupt */
#define USB_PR_BULK 0x50 /* Bulk-only */
/* USB subclass value = the protocol encapsulation */
#define USB_SC_RBC 0x01 /* Reduced Block Commands (flash) */
#define USB_SC_8020 0x02 /* SFF-8020i, MMC-2, ATAPI (CD-ROM) */
#define USB_SC_QIC 0x03 /* QIC-157 (tape) */
#define USB_SC_UFI 0x04 /* UFI (floppy) */
#define USB_SC_8070 0x05 /* SFF-8070i (removable) */
#define USB_SC_SCSI 0x06 /* Transparent SCSI */
/* Bulk-only data structures */
/* Command Block Wrapper */
struct fsg_bulk_cb_wrap {
__le32 Signature; /* Contains 'USBC' */
u32 Tag; /* Unique per command id */
__le32 DataTransferLength; /* Size of the data */
u8 Flags; /* Direction in bit 7 */
u8 Lun; /* LUN (normally 0) */
u8 Length; /* Of the CDB, <= MAX_COMMAND_SIZE */
u8 CDB[16]; /* Command Data Block */
};
#define USB_BULK_CB_WRAP_LEN 31
#define USB_BULK_CB_SIG 0x43425355 /* Spells out USBC */
#define USB_BULK_IN_FLAG 0x80
/* Command Status Wrapper */
struct bulk_cs_wrap {
__le32 Signature; /* Should = 'USBS' */
u32 Tag; /* Same as original command */
__le32 Residue; /* Amount not transferred */
u8 Status; /* See below */
};
#define USB_BULK_CS_WRAP_LEN 13
#define USB_BULK_CS_SIG 0x53425355 /* Spells out 'USBS' */
#define USB_STATUS_PASS 0
#define USB_STATUS_FAIL 1
#define USB_STATUS_PHASE_ERROR 2
/* Bulk-only class specific requests */
#define USB_BULK_RESET_REQUEST 0xff
#define USB_BULK_GET_MAX_LUN_REQUEST 0xfe
/* CBI Interrupt data structure */
struct interrupt_data {
u8 bType;
u8 bValue;
};
#define CBI_INTERRUPT_DATA_LEN 2
/* CBI Accept Device-Specific Command request */
#define USB_CBI_ADSC_REQUEST 0x00
/* Length of a SCSI Command Data Block */
#define MAX_COMMAND_SIZE 16
/* SCSI commands that we recognize */
#define SC_FORMAT_UNIT 0x04
#define SC_INQUIRY 0x12
#define SC_MODE_SELECT_6 0x15
#define SC_MODE_SELECT_10 0x55
#define SC_MODE_SENSE_6 0x1a
#define SC_MODE_SENSE_10 0x5a
#define SC_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
#define SC_READ_6 0x08
#define SC_READ_10 0x28
#define SC_READ_12 0xa8
#define SC_READ_CAPACITY 0x25
#define SC_READ_FORMAT_CAPACITIES 0x23
#define SC_READ_HEADER 0x44
#define SC_READ_TOC 0x43
#define SC_RELEASE 0x17
#define SC_REQUEST_SENSE 0x03
#define SC_RESERVE 0x16
#define SC_SEND_DIAGNOSTIC 0x1d
#define SC_START_STOP_UNIT 0x1b
#define SC_SYNCHRONIZE_CACHE 0x35
#define SC_TEST_UNIT_READY 0x00
#define SC_VERIFY 0x2f
#define SC_WRITE_6 0x0a
#define SC_WRITE_10 0x2a
#define SC_WRITE_12 0xaa
/* SCSI Sense Key/Additional Sense Code/ASC Qualifier values */
#define SS_NO_SENSE 0
#define SS_COMMUNICATION_FAILURE 0x040800
#define SS_INVALID_COMMAND 0x052000
#define SS_INVALID_FIELD_IN_CDB 0x052400
#define SS_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x052100
#define SS_LOGICAL_UNIT_NOT_SUPPORTED 0x052500
#define SS_MEDIUM_NOT_PRESENT 0x023a00
#define SS_MEDIUM_REMOVAL_PREVENTED 0x055302
#define SS_NOT_READY_TO_READY_TRANSITION 0x062800
#define SS_RESET_OCCURRED 0x062900
#define SS_SAVING_PARAMETERS_NOT_SUPPORTED 0x053900
#define SS_UNRECOVERED_READ_ERROR 0x031100
#define SS_WRITE_ERROR 0x030c02
#define SS_WRITE_PROTECTED 0x072700
#define SK(x) ((u8) ((x) >> 16)) /* Sense Key byte, etc. */
#define ASC(x) ((u8) ((x) >> 8))
#define ASCQ(x) ((u8) (x))
/*-------------------------------------------------------------------------*/
struct fsg_lun {
struct file *filp;
loff_t file_length;
loff_t num_sectors;
unsigned int initially_ro:1;
unsigned int ro:1;
unsigned int removable:1;
unsigned int cdrom:1;
unsigned int prevent_medium_removal:1;
unsigned int registered:1;
unsigned int info_valid:1;
u32 sense_data;
u32 sense_data_info;
u32 unit_attention_data;
struct device dev;
};
#define fsg_lun_is_open(curlun) ((curlun)->filp != NULL)
static struct fsg_lun *fsg_lun_from_dev(struct device *dev)
{
return container_of(dev, struct fsg_lun, dev);
}
/* Big enough to hold our biggest descriptor */
#define EP0_BUFSIZE 256
#define DELAYED_STATUS (EP0_BUFSIZE + 999) /* An impossibly large value */
/* Number of buffers we will use. 2 is enough for double-buffering */
#define FSG_NUM_BUFFERS 2
/* Default size of buffer length. */
#define FSG_BUFLEN ((u32)16384)
/* Maximal number of LUNs supported in mass storage function */
#define FSG_MAX_LUNS 8
enum fsg_buffer_state {
BUF_STATE_EMPTY = 0,
BUF_STATE_FULL,
BUF_STATE_BUSY
};
struct fsg_buffhd {
#ifdef FSG_BUFFHD_STATIC_BUFFER
char buf[FSG_BUFLEN];
#else
void *buf;
#endif
enum fsg_buffer_state state;
struct fsg_buffhd *next;
/* The NetChip 2280 is faster, and handles some protocol faults
* better, if we don't submit any short bulk-out read requests.
* So we will record the intended request length here. */
unsigned int bulk_out_intended_length;
struct usb_request *inreq;
int inreq_busy;
struct usb_request *outreq;
int outreq_busy;
};
enum fsg_state {
/* This one isn't used anywhere */
FSG_STATE_COMMAND_PHASE = -10,
FSG_STATE_DATA_PHASE,
FSG_STATE_STATUS_PHASE,
FSG_STATE_IDLE = 0,
FSG_STATE_ABORT_BULK_OUT,
FSG_STATE_RESET,
FSG_STATE_INTERFACE_CHANGE,
FSG_STATE_CONFIG_CHANGE_DISABLE,
FSG_STATE_CONFIG_CHANGE,
FSG_STATE_DISCONNECT,
FSG_STATE_EXIT,
FSG_STATE_TERMINATED
};
enum data_direction {
DATA_DIR_UNKNOWN = 0,
DATA_DIR_FROM_HOST,
DATA_DIR_TO_HOST,
DATA_DIR_NONE
};
/*-------------------------------------------------------------------------*/
static inline u32 get_unaligned_be24(u8 *buf)
{
return 0xffffff & (u32) get_unaligned_be32(buf - 1);
}
/*-------------------------------------------------------------------------*/
enum {
#ifndef FSG_NO_DEVICE_STRINGS
FSG_STRING_MANUFACTURER = 1,
FSG_STRING_PRODUCT,
FSG_STRING_SERIAL,
FSG_STRING_CONFIG,
#endif
FSG_STRING_INTERFACE
};
#ifndef FSG_NO_OTG
static struct usb_otg_descriptor
fsg_otg_desc = {
.bLength = sizeof fsg_otg_desc,
.bDescriptorType = USB_DT_OTG,
.bmAttributes = USB_OTG_SRP,
};
#endif
/* There is only one interface. */
static struct usb_interface_descriptor
fsg_intf_desc = {
.bLength = sizeof fsg_intf_desc,
.bDescriptorType = USB_DT_INTERFACE,
.bNumEndpoints = 2, /* Adjusted during fsg_bind() */
.bInterfaceClass = USB_CLASS_MASS_STORAGE,
.bInterfaceSubClass = USB_SC_SCSI, /* Adjusted during fsg_bind() */
.bInterfaceProtocol = USB_PR_BULK, /* Adjusted during fsg_bind() */
.iInterface = FSG_STRING_INTERFACE,
};
/* Three full-speed endpoint descriptors: bulk-in, bulk-out,
* and interrupt-in. */
static struct usb_endpoint_descriptor
fsg_fs_bulk_in_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_BULK,
/* wMaxPacketSize set by autoconfiguration */
};
static struct usb_endpoint_descriptor
fsg_fs_bulk_out_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_OUT,
.bmAttributes = USB_ENDPOINT_XFER_BULK,
/* wMaxPacketSize set by autoconfiguration */
};
#ifndef FSG_NO_INTR_EP
static struct usb_endpoint_descriptor
fsg_fs_intr_in_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(2),
.bInterval = 32, /* frames -> 32 ms */
};
#ifndef FSG_NO_OTG
# define FSG_FS_FUNCTION_PRE_EP_ENTRIES 2
#else
# define FSG_FS_FUNCTION_PRE_EP_ENTRIES 1
#endif
#endif
static struct usb_descriptor_header *fsg_fs_function[] = {
#ifndef FSG_NO_OTG
(struct usb_descriptor_header *) &fsg_otg_desc,
#endif
(struct usb_descriptor_header *) &fsg_intf_desc,
(struct usb_descriptor_header *) &fsg_fs_bulk_in_desc,
(struct usb_descriptor_header *) &fsg_fs_bulk_out_desc,
#ifndef FSG_NO_INTR_EP
(struct usb_descriptor_header *) &fsg_fs_intr_in_desc,
#endif
NULL,
};
/*
* USB 2.0 devices need to expose both high speed and full speed
* descriptors, unless they only run at full speed.
*
* That means alternate endpoint descriptors (bigger packets)
* and a "device qualifier" ... plus more construction options
* for the config descriptor.
*/
static struct usb_endpoint_descriptor
fsg_hs_bulk_in_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
/* bEndpointAddress copied from fs_bulk_in_desc during fsg_bind() */
.bmAttributes = USB_ENDPOINT_XFER_BULK,
.wMaxPacketSize = cpu_to_le16(512),
};
static struct usb_endpoint_descriptor
fsg_hs_bulk_out_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
/* bEndpointAddress copied from fs_bulk_out_desc during fsg_bind() */
.bmAttributes = USB_ENDPOINT_XFER_BULK,
.wMaxPacketSize = cpu_to_le16(512),
.bInterval = 1, /* NAK every 1 uframe */
};
#ifndef FSG_NO_INTR_EP
static struct usb_endpoint_descriptor
fsg_hs_intr_in_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
/* bEndpointAddress copied from fs_intr_in_desc during fsg_bind() */
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(2),
.bInterval = 9, /* 2**(9-1) = 256 uframes -> 32 ms */
};
#ifndef FSG_NO_OTG
# define FSG_HS_FUNCTION_PRE_EP_ENTRIES 2
#else
# define FSG_HS_FUNCTION_PRE_EP_ENTRIES 1
#endif
#endif
static struct usb_descriptor_header *fsg_hs_function[] = {
#ifndef FSG_NO_OTG
(struct usb_descriptor_header *) &fsg_otg_desc,
#endif
(struct usb_descriptor_header *) &fsg_intf_desc,
(struct usb_descriptor_header *) &fsg_hs_bulk_in_desc,
(struct usb_descriptor_header *) &fsg_hs_bulk_out_desc,
#ifndef FSG_NO_INTR_EP
(struct usb_descriptor_header *) &fsg_hs_intr_in_desc,
#endif
NULL,
};
/* Maxpacket and other transfer characteristics vary by speed. */
static struct usb_endpoint_descriptor *
fsg_ep_desc(struct usb_gadget *g, struct usb_endpoint_descriptor *fs,
struct usb_endpoint_descriptor *hs)
{
if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
return hs;
return fs;
}
/* Static strings, in UTF-8 (for simplicity we use only ASCII characters) */
static struct usb_string fsg_strings[] = {
#ifndef FSG_NO_DEVICE_STRINGS
{FSG_STRING_MANUFACTURER, fsg_string_manufacturer},
{FSG_STRING_PRODUCT, fsg_string_product},
{FSG_STRING_SERIAL, fsg_string_serial},
{FSG_STRING_CONFIG, fsg_string_config},
#endif
{FSG_STRING_INTERFACE, fsg_string_interface},
{}
};
static struct usb_gadget_strings fsg_stringtab = {
.language = 0x0409, /* en-us */
.strings = fsg_strings,
};
/*-------------------------------------------------------------------------*/
/* If the next two routines are called while the gadget is registered,
* the caller must own fsg->filesem for writing. */
static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
{
int ro;
struct file *filp = NULL;
int rc = -EINVAL;
struct inode *inode = NULL;
loff_t size;
loff_t num_sectors;
loff_t min_sectors;
/* R/W if we can, R/O if we must */
ro = curlun->initially_ro;
if (!ro) {
filp = filp_open(filename, O_RDWR | O_LARGEFILE, 0);
if (-EROFS == PTR_ERR(filp))
ro = 1;
}
if (ro)
filp = filp_open(filename, O_RDONLY | O_LARGEFILE, 0);
if (IS_ERR(filp)) {
LINFO(curlun, "unable to open backing file: %s\n", filename);
return PTR_ERR(filp);
}
if (!(filp->f_mode & FMODE_WRITE))
ro = 1;
if (filp->f_path.dentry)
inode = filp->f_path.dentry->d_inode;
if (inode && S_ISBLK(inode->i_mode)) {
if (bdev_read_only(inode->i_bdev))
ro = 1;
} else if (!inode || !S_ISREG(inode->i_mode)) {
LINFO(curlun, "invalid file type: %s\n", filename);
goto out;
}
/* If we can't read the file, it's no good.
* If we can't write the file, use it read-only. */
if (!filp->f_op || !(filp->f_op->read || filp->f_op->aio_read)) {
LINFO(curlun, "file not readable: %s\n", filename);
goto out;
}
if (!(filp->f_op->write || filp->f_op->aio_write))
ro = 1;
size = i_size_read(inode->i_mapping->host);
if (size < 0) {
LINFO(curlun, "unable to find file size: %s\n", filename);
rc = (int) size;
goto out;
}
num_sectors = size >> 9; /* File size in 512-byte blocks */
min_sectors = 1;
if (curlun->cdrom) {
num_sectors &= ~3; /* Reduce to a multiple of 2048 */
min_sectors = 300*4; /* Smallest track is 300 frames */
if (num_sectors >= 256*60*75*4) {
num_sectors = (256*60*75 - 1) * 4;
LINFO(curlun, "file too big: %s\n", filename);
LINFO(curlun, "using only first %d blocks\n",
(int) num_sectors);
}
}
if (num_sectors < min_sectors) {
LINFO(curlun, "file too small: %s\n", filename);
rc = -ETOOSMALL;
goto out;
}
get_file(filp);
curlun->ro = ro;
curlun->filp = filp;
curlun->file_length = size;
curlun->num_sectors = num_sectors;
LDBG(curlun, "open backing file: %s\n", filename);
rc = 0;
out:
filp_close(filp, current->files);
return rc;
}
static void fsg_lun_close(struct fsg_lun *curlun)
{
if (curlun->filp) {
LDBG(curlun, "close backing file\n");
fput(curlun->filp);
curlun->filp = NULL;
}
}
/*-------------------------------------------------------------------------*/
/* Sync the file data, don't bother with the metadata.
* This code was copied from fs/buffer.c:sys_fdatasync(). */
static int fsg_lun_fsync_sub(struct fsg_lun *curlun)
{
struct file *filp = curlun->filp;
if (curlun->ro || !filp)
return 0;
return vfs_fsync(filp, filp->f_path.dentry, 1);
}
static void store_cdrom_address(u8 *dest, int msf, u32 addr)
{
if (msf) {
/* Convert to Minutes-Seconds-Frames */
addr >>= 2; /* Convert to 2048-byte frames */
addr += 2*75; /* Lead-in occupies 2 seconds */
dest[3] = addr % 75; /* Frames */
addr /= 75;
dest[2] = addr % 60; /* Seconds */
addr /= 60;
dest[1] = addr; /* Minutes */
dest[0] = 0; /* Reserved */
} else {
/* Absolute sector */
put_unaligned_be32(addr, dest);
}
}
/*-------------------------------------------------------------------------*/
static ssize_t fsg_show_ro(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
return sprintf(buf, "%d\n", fsg_lun_is_open(curlun)
? curlun->ro
: curlun->initially_ro);
}
static ssize_t fsg_show_file(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
struct rw_semaphore *filesem = dev_get_drvdata(dev);
char *p;
ssize_t rc;
down_read(filesem);
if (fsg_lun_is_open(curlun)) { /* Get the complete pathname */
p = d_path(&curlun->filp->f_path, buf, PAGE_SIZE - 1);
if (IS_ERR(p))
rc = PTR_ERR(p);
else {
rc = strlen(p);
memmove(buf, p, rc);
buf[rc] = '\n'; /* Add a newline */
buf[++rc] = 0;
}
} else { /* No file, return 0 bytes */
*buf = 0;
rc = 0;
}
up_read(filesem);
return rc;
}
static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
ssize_t rc = count;
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
struct rw_semaphore *filesem = dev_get_drvdata(dev);
int i;
if (sscanf(buf, "%d", &i) != 1)
return -EINVAL;
/* Allow the write-enable status to change only while the backing file
* is closed. */
down_read(filesem);
if (fsg_lun_is_open(curlun)) {
LDBG(curlun, "read-only status change prevented\n");
rc = -EBUSY;
} else {
curlun->ro = !!i;
curlun->initially_ro = !!i;
LDBG(curlun, "read-only status set to %d\n", curlun->ro);
}
up_read(filesem);
return rc;
}
static ssize_t fsg_store_file(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
struct rw_semaphore *filesem = dev_get_drvdata(dev);
int rc = 0;
if (curlun->prevent_medium_removal && fsg_lun_is_open(curlun)) {
LDBG(curlun, "eject attempt prevented\n");
return -EBUSY; /* "Door is locked" */
}
/* Remove a trailing newline */
if (count > 0 && buf[count-1] == '\n')
((char *) buf)[count-1] = 0; /* Ugh! */
/* Eject current medium */
down_write(filesem);
if (fsg_lun_is_open(curlun)) {
fsg_lun_close(curlun);
curlun->unit_attention_data = SS_MEDIUM_NOT_PRESENT;
}
/* Load new medium */
if (count > 0 && buf[0]) {
rc = fsg_lun_open(curlun, buf);
if (rc == 0)
curlun->unit_attention_data =
SS_NOT_READY_TO_READY_TRANSITION;
}
up_write(filesem);
return (rc < 0 ? rc : count);
}

View File

@ -1,738 +0,0 @@
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
* This UsbFunction file is based on and inheritated from
* the original file (f_sourcesink.c) and work done by
* David Brownell
*
* >> f_sourcesink.c - USB peripheral source/sink configuration driver <<
*
* >> Copyright (C) 2003-2008 David Brownell <<
* >> Copyright (C) 2008 by Nokia Corporation <<
*
*/
/*
*
* HID IN/OUT Interrupt transfer FUNCTION ...
*
*/
struct f_rudolf {
struct usb_function function;
struct usb_ep *in_ep;
struct usb_ep *out_ep;
};
enum // Used for signaling the IN stuff USB-state
{ // Data from the Brick to the HOST
USB_DATA_IDLE, //
USB_DATA_BUSY, // Ongoing USB request
USB_DATA_PENDING, // Data ready for X-fer, but USB busy
USB_DATA_READY, // Initial setting
};
int input_state = USB_DATA_IDLE;
struct usb_ep *save_in_ep;
struct usb_request *save_in_req;
#ifndef PCASM
static inline struct f_rudolf *func_to_rudolf(struct usb_function *f)
{
return container_of(f, struct f_rudolf, function);
}
#else
// Keep Eclipse happy
#endif
static struct usb_interface_descriptor rudolf_intf = {
.bLength = sizeof rudolf_intf,
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 2, // Just plain in and out
.bInterfaceClass = USB_CLASS_HID, // We go for NONE custom-driver
.bInterfaceSubClass = 0,
.bInterfaceProtocol = 0,
/* .iInterface = DYNAMIC */
};
static struct hid_descriptor hs_hid_rudolf_desc = {
.bLength = sizeof hs_hid_rudolf_desc,
.bDescriptorType = HID_DT_HID,
.bcdHID = cpu_to_le16(0x0110),
.bCountryCode = 0x00,
.bNumDescriptors = 0x01, // "The one and only"
.desc[0].bDescriptorType = 0x22, // Report Descriptor Type - 0x22 = HID
.desc[0].wDescriptorLength = sizeof hs_hid_report_descriptor,
/*.desc[0].bDescriptorType = DYNAMIC */
/*.desc[0].wDescriptorLenght= DYNAMIC */
};
static struct hid_descriptor fs_hid_rudolf_desc = {
.bLength = sizeof fs_hid_rudolf_desc,
.bDescriptorType = HID_DT_HID,
.bcdHID = cpu_to_le16(0x0110),
.bCountryCode = 0x00,
.bNumDescriptors = 0x01, // "The one and only"
.desc[0].bDescriptorType = 0x22, // Report Descriptor Type - 0x22 = HID
.desc[0].wDescriptorLength = sizeof fs_hid_report_descriptor,
};
/* full speed support: */
static struct usb_endpoint_descriptor rudolf_out_fs_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_OUT,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(64),
.bInterval = 1, /* 1 = 1 mSec POLL rate for FS */
};
static struct usb_endpoint_descriptor rudolf_in_fs_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(64),
.bInterval = 1, /* 1 = 1 mSec POLL rate for FS */
};
/* high speed support: */
static struct usb_endpoint_descriptor rudolf_in_hs_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(1024),
.bInterval = 4, /* Calculated as :
* 2^(value-1) * 125uS
* i.e. value 1: 2^(1-1) * 125 uSec = 125 uSec
* - 4: 2^(4-1) * 125 uSec = 1 mSec
*/
};
static struct usb_endpoint_descriptor rudolf_out_hs_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_OUT,
.bmAttributes = USB_ENDPOINT_XFER_INT,
.wMaxPacketSize = cpu_to_le16(1024),
.bInterval = 4, /* Calculated as :
* 2^(value-1) * 125uS
* i.e. value 1: 2^(1-1) * 125 uSec = 125 uSec
* - 4: 2^(4-1) * 125 uSec = 1 mSec
*/
};
static struct usb_descriptor_header *hs_rudolf_descs[] = {
(struct usb_descriptor_header *) &rudolf_intf,
(struct usb_descriptor_header *) &hs_hid_rudolf_desc,
(struct usb_descriptor_header *) &rudolf_in_hs_desc,
(struct usb_descriptor_header *) &rudolf_out_hs_desc,
NULL,
};
static struct usb_descriptor_header *fs_rudolf_descs[] = {
(struct usb_descriptor_header *) &rudolf_intf,
(struct usb_descriptor_header *) &fs_hid_rudolf_desc,
(struct usb_descriptor_header *) &rudolf_in_fs_desc,
(struct usb_descriptor_header *) &rudolf_out_fs_desc,
NULL,
};
/* function-specific strings: */
static struct usb_string strings_rudolf[] = {
[0].s = "Xfer data to and from EV3 brick",
{ } /* end of list */
};
static struct usb_gadget_strings stringtab_rudolf = {
.language = 0x0409, /* en-us */
.strings = strings_rudolf,
};
static struct usb_gadget_strings *rudolf_strings[] = {
&stringtab_rudolf,
NULL,
};
/*-------------------------------------------------------------------------*/
static int
f_rudolf_bind(struct usb_configuration *c, struct usb_function *f)
{
struct usb_composite_dev *cdev = c->cdev;
struct f_rudolf *rudolf = func_to_rudolf(f);
int id;
/* allocate interface ID(s) */
id = usb_interface_id(c, f);
if (id < 0)
return id;
rudolf_intf.bInterfaceNumber = id;
/* allocate endpoints */
rudolf->in_ep = usb_ep_autoconfig(cdev->gadget, &rudolf_in_fs_desc);
if (!rudolf->in_ep) {
autoconf_fail:
ERROR(cdev, "%s: can't autoconfigure on %s\n",
f->name, cdev->gadget->name);
return -ENODEV;
}
rudolf->in_ep->driver_data = cdev; /* claim */
rudolf->out_ep = usb_ep_autoconfig(cdev->gadget, &rudolf_out_fs_desc);
if (!rudolf->out_ep)
goto autoconf_fail;
rudolf->out_ep->driver_data = cdev; /* claim */
/* support high speed hardware */
if (gadget_is_dualspeed(c->cdev->gadget)) {
rudolf_in_hs_desc.bEndpointAddress =
rudolf_in_fs_desc.bEndpointAddress;
rudolf_out_hs_desc.bEndpointAddress =
rudolf_out_fs_desc.bEndpointAddress;
f->hs_descriptors = hs_rudolf_descs;
f->descriptors = fs_rudolf_descs;
}
DBG(cdev, "%s speed %s: IN/%s, OUT/%s\n",
gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full",
f->name, rudolf->in_ep->name, rudolf->out_ep->name);
return 0;
}
static void
f_rudolf_unbind(struct usb_configuration *c, struct usb_function *f)
{
kfree(func_to_rudolf(f));
}
static void usb_req_arm(struct usb_ep *ep, struct usb_request *req)
{
int status;
if (UsbSpeed.Speed == FULL_SPEED)
{
req->length = 64;
req->actual = 64;
}
else
{
req->length = 1024;
req->actual = 1024;
}
status = usb_ep_queue(ep, req, GFP_ATOMIC);
if (status) {
usb_ep_set_halt(ep);
/* FIXME recover later ... somehow */
}
}
static int read_data_from_host(struct usb_request *req)
{
unsigned i;
u8 *buf = req->buf;
int from_host_length = 0; // NO ACCESS LOCKS YET
// test for actual length > 0
for (i = 0; i < req->actual; i++, buf++)
{
usb_char_buffer_out[i] = *buf;
from_host_length++;
}
return (from_host_length);
}
static void write_data_to_the_host(struct usb_ep *ep, struct usb_request *req)
{
unsigned i;
u8 *buf = req->buf;
//#define DEBUG
#ifdef DEBUG
printk("WR to HOST req->length = %d\r\n", req->length);
#endif
#undef DEBUG
//#define DEBUG
#ifdef DEBUG
printk("USB = %d, %d\r\n", usb_char_buffer_in[2], usb_char_buffer_in[3]);
#endif
#undef DEBUG
for (i = 0; i < req->length; i++)
*buf++ = usb_char_buffer_in[i];
usb_char_in_length = 0; // Reset and ready
}
static void rudolf_complete(struct usb_ep *ep, struct usb_request *req)
{
struct f_rudolf *rudolf = ep->driver_data;
int status = req->status;
switch ( status ) {
case 0: /* normal completion? */
if (ep == rudolf->out_ep) // An OUT completion?
{
//#define DEBUG
#ifdef DEBUG
printk("Rudolf_complete OUT\n");
#endif
usb_char_out_length = read_data_from_host(req);
usb_req_arm(ep, req);
}
else // We have an INPUT request complete
{
//#define DEBUG
#ifdef DEBUG
printk("Rudolf_complete IN\n");
#endif
switch(input_state) // State of Brick data x-fer
{
case USB_DATA_READY: //should be BUSY or PENDING....
#ifdef DEBUG
printk("IN_IN_IN - READY ?????\n");
#endif
break;
case USB_DATA_PENDING: //
// #define DEBUG
#ifdef DEBUG
printk("IN_IN_IN - PENDING settes to BUSY\n");
#endif
input_state = USB_DATA_BUSY;
write_data_to_the_host(ep, req);
usb_req_arm(ep, req); // new request
break;
case USB_DATA_BUSY: //
#ifdef DEBUG
printk("IN_IN_IN - BUSY settes to READY\n");
#endif
#undef DEBUG
input_state = USB_DATA_READY;
// and relax
break;
case USB_DATA_IDLE: // too lazy
#ifdef DEBUG
printk("IN_IN_IN - IDLE\n");
#endif
//#undef DEBUG
break;
default: break; // hmmm.
}
// Reset the buffer size - Ready again
usb_char_in_length = 0;
}
break;
/* this endpoint is normally active while we're configured */
case -ESHUTDOWN: /* disconnect from host */
// REMOVED 26102012 (*pUsbSpeed).Speed = FULL_SPEED;
case -ECONNABORTED: /* hardware forced ep reset */
case -ECONNRESET: /* request dequeued */
//case -ESHUTDOWN: /* disconnect from host */
if (ep == rudolf->out_ep)
read_data_from_host(req);
free_ep_req(ep, req);
return;
case -EOVERFLOW: /* buffer overrun on read means that
we didn't provide a big enough
buffer.
*/
default:
//#if 1
// DBG(cdev, "%s complete --> %d, %d/%d\n", ep->name,
// status, req->actual, req->length);
//#endif
case -EREMOTEIO: /* short read */
break;
}
}
static int rudolf_start_ep(struct f_rudolf *rudolf, bool is_in)
{
struct usb_ep *ep;
struct usb_request *req;
int status;
ep = is_in ? rudolf->in_ep : rudolf->out_ep;
req = alloc_ep_req(ep);
if (!req)
return -ENOMEM;
req->complete = rudolf_complete;
#ifdef DEBUG
printk("UsbSpeed.Speed = %d\n\r", UsbSpeed.Speed);
#endif
if (UsbSpeed.Speed == FULL_SPEED)
{
#ifdef DEBUG
printk("rudolf_start_ep FULL\n\r");
#endif
(*pUsbSpeed).Speed = FULL_SPEED;
req->length = 64; // Full speed max buffer size
req->actual = 64;
}
else
{
#ifdef DEBUG
printk("rudolf_start_ep HIGH\n\r");
#endif
(*pUsbSpeed).Speed = HIGH_SPEED;
req->length = 1024; // High speed max buffer size
req->actual = 1024;
}
if (is_in)
{
save_in_ep = ep;
save_in_req = req;
#ifdef DEBUG
printk("req->length = %d ***** Rudolf_Start_Ep_in\n\r", req->length);
#endif
// reinit_write_data(ep, req);
input_state = USB_DATA_BUSY;
}
else
{
#ifdef DEBUG
printk("***** Rudolf_Start_Ep_out\n");
#endif
}
status = usb_ep_queue(ep, req, GFP_ATOMIC);
if (status) {
struct usb_composite_dev *cdev;
cdev = rudolf->function.config->cdev;
ERROR(cdev, "start %s %s --> %d\n",
is_in ? "IN" : "OUT",
ep->name, status);
free_ep_req(ep, req);
}
return status;
}
static void disable_rudolf(struct f_rudolf *rudolf)
{
struct usb_composite_dev *cdev;
cdev = rudolf->function.config->cdev;
disable_endpoints(cdev, rudolf->in_ep, rudolf->out_ep);
VDBG(cdev, "%s disabled\n", rudolf->function.name);
}
static int
enable_rudolf(struct usb_composite_dev *cdev, struct f_rudolf *rudolf)
{
int result = 0;
const struct usb_endpoint_descriptor *ep_in, *ep_out;
struct usb_ep *ep;
ep_in = ep_choose(cdev->gadget, &rudolf_in_hs_desc, &rudolf_in_fs_desc);
ep_out = ep_choose(cdev->gadget, &rudolf_out_hs_desc, &rudolf_out_fs_desc);
ep = rudolf->in_ep;
result = usb_ep_enable(ep, ep_in);
if (result < 0)
return result;
ep->driver_data = rudolf;
result = rudolf_start_ep(rudolf, true);
if (result < 0) {
fail:
ep = rudolf->in_ep;
usb_ep_disable(ep);
ep->driver_data = NULL;
return result;
}
/* one endpoint reads (sinks) anything OUT (from the host) */
ep = rudolf->out_ep;
result = usb_ep_enable(ep, ep_out);
if (result < 0)
goto fail;
ep->driver_data = rudolf;
result = rudolf_start_ep(rudolf, false);
if (result < 0) {
usb_ep_disable(ep);
ep->driver_data = NULL;
goto fail;
}
DBG(cdev, "%s enabled\n", rudolf->function.name);
return result;
}
static int f_rudolf_set_alt(struct usb_function *f,
unsigned intf, unsigned alt)
{
struct f_rudolf *rudolf = func_to_rudolf(f);
struct usb_composite_dev *cdev = f->config->cdev;
/* we know alt is zero */
if (rudolf->in_ep->driver_data)
disable_rudolf(rudolf);
return enable_rudolf(cdev, rudolf);
}
static void f_rudolf_disable(struct usb_function *f)
{
struct f_rudolf *rudolf = func_to_rudolf(f);
disable_rudolf(rudolf);
}
/*-------------------------------------------------------------------------*/
static int msg_config(struct usb_configuration *c);
static int rudolf_bind_config(struct usb_configuration *c)
{
struct f_rudolf *rudolf;
int status;
rudolf = kzalloc(sizeof *rudolf, GFP_KERNEL);
if (!rudolf)
return -ENOMEM;
rudolf->function.name = "rudolf xfer";
rudolf->function.descriptors = hs_rudolf_descs;
rudolf->function.bind = f_rudolf_bind;
rudolf->function.unbind = f_rudolf_unbind;
rudolf->function.set_alt = f_rudolf_set_alt;
rudolf->function.disable = f_rudolf_disable;
status = usb_add_function(c, &rudolf->function);
if (status) {
kfree(rudolf);
return status;
}
status = msg_config(c);
if (status) {
kfree(rudolf);
return status;
}
return status;
}
#ifndef PCASM
static int rudolf_setup(struct usb_configuration *c,
const struct usb_ctrlrequest *ctrl)
{
struct usb_request *req = c->cdev->req;
int value = -EOPNOTSUPP;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u16 w_value = le16_to_cpu(ctrl->wValue);
u16 w_length = le16_to_cpu(ctrl->wLength);
u16 length = 0;
/* composite driver infrastructure handles everything except
* the two control test requests.
*/
switch (ctrl->bRequest) {
/*
* These are the same vendor-specific requests supported by
* Intel's USB 2.0 compliance test devices. We exceed that
* device spec by allowing multiple-packet requests.
*
* NOTE: the Control-OUT data stays in req->buf ... better
* would be copying it into a scratch buffer, so that other
* requests may safely intervene.
*/
case 0x5b: /* control WRITE test -- fill the buffer */
if (ctrl->bRequestType != (USB_DIR_OUT|USB_TYPE_VENDOR))
goto unknown;
if (w_value || w_index)
break;
/* just read that many bytes into the buffer */
if (w_length > req->length)
break;
value = w_length;
break;
case 0x5c: /* control READ test -- return the buffer */
if (ctrl->bRequestType != (USB_DIR_IN|USB_TYPE_VENDOR))
goto unknown;
if (w_value || w_index)
break;
/* expect those bytes are still in the buffer; send back */
if (w_length > req->length)
break;
value = w_length;
break;
default:
unknown:
VDBG(c->cdev,
"unknown control req%02x.%02x v%04x i%04x l%d\n",
ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length);
}
//HER SKAL HID DESC SENDES!!!
switch ((ctrl->bRequestType << 8) | ctrl->bRequest) {
case ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8
| USB_REQ_GET_DESCRIPTOR):
switch (w_value >> 8) {
case HID_DT_REPORT:
//VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n");
length = w_length;
length = min_t(unsigned short, length,
sizeof hs_hid_report_descriptor);
memcpy(req->buf, hs_hid_report_descriptor, length);
value = length;
goto respond;
break;
default:
//VDBG(cdev, "Unknown decriptor request 0x%x\n",
// value >> 8);
goto stall;
break;
}
break;
default:
//VDBG(cdev, "Unknown request 0x%x\n",
// ctrl->bRequest);
goto stall;
break;
}
//HERTIL
/* respond with data transfer or status phase? */
stall:
return -EOPNOTSUPP;
respond:
if (value >= 0) {
VDBG(c->cdev, "source/sink req%02x.%02x v%04x i%04x l%d\n",
ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length);
req->zero = 0;
req->length = value;
value = usb_ep_queue(c->cdev->gadget->ep0, req, GFP_ATOMIC);
if (value < 0)
ERROR(c->cdev, "source/sinkc response, err %d\n",
value);
}
/* device either stalls (value < 0) or reports success */
return value;
}
#else
// Keep Eclipse happy
#endif
static struct usb_configuration rudolf_driver = {
.label = "rudolf driver",
.strings = rudolf_strings,
.bind = rudolf_bind_config,
.setup = rudolf_setup,
.bConfigurationValue = 1,
.bmAttributes = USB_CONFIG_ATT_SELFPOWER,
/* .iConfiguration = DYNAMIC */
};
/**
*
*/
int rudolf_add(struct usb_composite_dev *cdev, bool autoresume)
{
int id;
/* allocate string ID(s) */
id = usb_string_id(cdev);
if (id < 0)
return id;
strings_rudolf[0].id = id;
rudolf_intf.iInterface = id;
rudolf_driver.iConfiguration = 1; // id;
/* support autoresume for remote wakeup testing */
if (autoresume)
rudolf_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
/* support OTG systems */
if (gadget_is_otg(cdev->gadget)) {
rudolf_driver.descriptors = otg_desc;
rudolf_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
}
return usb_add_config(cdev, &rudolf_driver);
}

View File

@ -1,7 +0,0 @@
#!/bin/sh
set -xe
scp -qr kernel uf2daemon Makefile vm:linux/pxt/
ssh vm "cd linux/pxt; make $1"
mkdir -p bin
scp vm:linux/pxt/bin/* bin/

View File

@ -1,14 +0,0 @@
# Patched EV3 image
The file `ev3-fs.patch` summarizes the changes done to the original V1.09D image.
You can see some text files are edited, the `d_usbdev.ko` is updated (sources in `../kernel`),
`uf2d` added (sources in `../uf2daemon`), and a stock `nbd.ko` module is added.
Additionally, the `edimax01.ko` is replaced by now much more popular `rtl8192cu.ko` (also stock).
The init script has a hook for running a shell script from `/mnt/ramdisk/`. This can be used
for testing different modules etc.
The kernel command line has been modified to:
* disable DMA for the MUSB driver - otherwise the mass storage device is very unstable
* increase the size of dmesg buffer to 128k

View File

@ -1,34 +0,0 @@
#!/bin/sh
let fs = require("fs")
let styles = {
"0": "rxtx",
"1": " tx",
"2": "rx ",
}
function build() {
let kern = fs.readFileSync( "foo")
let off = 0x0001df30
kern = kern.slice(off + 6 * 5, off + 6 * (5 + 6))
console.log(kern.toString("hex"))
off = 0
for (let i = 0; i < 30; ++i) {
if (kern[off+4] == 64) {
kern[off+4] = 0
kern[off+5] = 2
}
if(kern[off] == 3 || kern[off] == 4) {
kern[off+4] = 0
kern[off+5] = 1
}
console.log(`ep=${kern[off]} style=${styles[kern[off+1]]} buf=${kern[off+2] == 0 ? "sin" : kern[off+2] == 1 ? "dbl" : "XXX"} pad=${kern[off+3]} sz=${kern[off+4]+(kern[off+5]<<8)}`)
off += 6
}
console.log(kern.toString("hex"))
}
build()

View File

@ -1,53 +0,0 @@
diff -ur orig-ev3/etc/init.d/ev3init.sh dev-ev3/etc/init.d/ev3init.sh
--- orig-ev3/etc/init.d/ev3init.sh 1970-01-01 01:00:00.000000000 +0100
+++ dev-ev3/etc/init.d/ev3init.sh 2017-07-27 12:19:43.195041798 +0100
@@ -1,5 +1,7 @@
#!/bin/sh
+echo Y > /sys/module/printk/parameters/time
+
bluetoothd -n > /dev/null 2>&1 &
echo "Setting up VirtualDrive...";
@@ -60,3 +62,6 @@
sleep 2
hciattach /dev/ttyS2 texas 2000000 "flow" "nosleep" $STRING
sdptool add SP
+
+insmod /lib/modules/2.6.33-rc4/kernel/drivers/net/wireless/rtl8192cu.ko
+. /mnt/ramdisk/rc.local || :
Only in orig-ev3/home/root/lms2012/sys: exit~
diff -ur orig-ev3/home/root/lms2012/sys/init dev-ev3/home/root/lms2012/sys/init
--- orig-ev3/home/root/lms2012/sys/init 1970-01-01 01:00:00.000000000 +0100
+++ dev-ev3/home/root/lms2012/sys/init 2017-07-27 12:23:43.072605126 +0100
@@ -5,13 +5,15 @@
var=$(printf 'HostStr=%s SerialStr=%s' $(cat /home/root/lms2012/sys/settings/BrickName) $(cat /home/root/lms2012/sys/settings/BTser))
echo $var > /home/root/lms2012/sys/settings/UsbInfo.dat
+insmod ${PWD}/mod/nbd.ko
+${PWD}/uf2d
insmod ${PWD}/mod/d_iic.ko `cat /home/root/lms2012/sys/settings/HwId`
insmod ${PWD}/mod/d_uart.ko `cat /home/root/lms2012/sys/settings/HwId`
insmod ${PWD}/mod/d_power.ko `cat /home/root/lms2012/sys/settings/HwId`
insmod ${PWD}/mod/d_pwm.ko `cat /home/root/lms2012/sys/settings/HwId`
insmod ${PWD}/mod/d_ui.ko `cat /home/root/lms2012/sys/settings/HwId`
insmod ${PWD}/mod/d_analog.ko `cat /home/root/lms2012/sys/settings/HwId`
-insmod ${PWD}/mod/d_usbdev.ko `cat /home/root/lms2012/sys/settings/UsbInfo.dat`
+insmod ${PWD}/mod/d_usbdev.ko `cat /home/root/lms2012/sys/settings/UsbInfo.dat` file=/dev/nbd0
insmod ${PWD}/mod/d_usbhost.ko
insmod ${PWD}/mod/d_sound.ko `cat /home/root/lms2012/sys/settings/HwId`
insmod ${PWD}/mod/d_bt.ko `cat /home/root/lms2012/sys/settings/HwId`
@@ -29,6 +31,8 @@
chmod 666 /dev/lms_iic
chmod 666 /dev/lms_bt
+echo 4 > /proc/sys/kernel/printk
+
cd ..
ls -R > /dev/null
cd sys
Binary files orig-ev3/home/root/lms2012/sys/mod/d_usbdev.ko and dev-ev3/home/root/lms2012/sys/mod/d_usbdev.ko differ
Only in dev-ev3/home/root/lms2012/sys/mod: nbd.ko
Only in dev-ev3/home/root/lms2012/sys: uf2d
Only in orig-ev3/lib/modules/2.6.33-rc4/kernel/drivers/net/wireless: edimax01.ko
Only in dev-ev3/lib/modules/2.6.33-rc4/kernel/drivers/net/wireless: rtl8192cu.ko

View File

@ -1,55 +0,0 @@
#!/bin/sh
let fs = require("fs")
// we try to use shorter versions of all parameters for the additional parameters to fit
let bootargs = "mem=${memsize} initrd=${filesysaddr},${filesyssize} root=/dev/ram0 rw rootfstype=cramfs console=${console} ip=${ipaddr} lpj=747520 quiet"
let bootnews = "mem=64M initrd=0xC1180000,10M root=1:0 rw rootfstype=cramfs console=${console} lpj=747520 musb_hdrc.use_dma=0 log_buf_len=128k quiet"
let piggy = true
function build() {
if (bootnews.length > bootargs.length) {
console.log("args too long")
return
}
while (bootnews.length < bootargs.length)
bootnews += " "
let cr = fs.readFileSync("cram.bin")
if (cr.length > 10485760) {
console.log("too big by " + (cr.length - 10485760))
return
}
let img = fs.readFileSync("EV3 Firmware V1.09D.bin")
for (let i = 0; i < bootnews.length; ++i) {
if (img[0x21DDA + i] != bootargs.charCodeAt(i)) {
console.log("boot args mismatch")
return
}
img[0x21DDA + i] = bootnews.charCodeAt(i)
}
let off = 0x250000
if (img[off] != 0x45 || img[off + 1] != 0x3d) {
console.log("bad magic: " + img[off] + " / " + img[off+1])
return
}
cr.copy(img, off)
let kern = fs.readFileSync(piggy ? "piggy-patched.gzip" : "linux/arch/arm/boot/uImage")
off = piggy ? 0x0005540f : 0x00050000
if (img[off] != kern[0] || img[off+1] != kern[1]) {
console.log("bad kernel magic: " + img[off] + " / " + img[off+1])
return
}
kern.copy(img, off)
fs.writeFileSync("firmware.bin", img)
}
build()

View File

@ -1,9 +0,0 @@
#!/bin/sh
# dd if=EV3\ Firmware\ V1.09D.bin of=orig.cram bs=65536 skip=37 count=400
sudo cp linux/pxt/uf2daemon/server dev-ev3/home/root/lms2012/sys/uf2d
sudo cp linux/pxt/kernel/d_usbdev.ko dev-ev3/home/root/lms2012/sys/mod/d_usbdev.ko
sudo chown -R root:root dev-ev3/home/root/lms2012
sudo mkfs.cramfs dev-ev3 cram.bin
node img
ls -l firmware.bin

View File

@ -1,8 +0,0 @@
let small = "010100000004010200000004020100004000020200004000030100000004040000008000"
let big = "010100000004010200000004020100000002020200000002030100000001040000000001"
let fs = require("fs")
let kern = fs.readFileSync( "foo")
let kern2 = new Buffer(kern.toString("hex").replace(small, big), "hex")
fs.writeFileSync("foo2", kern2)

View File

@ -1,10 +0,0 @@
#!/bin/sh
./mk
ev3duder up bin/d_usbdev.ko ../prjs/ko/d_usbdev.ko
ev3duder up bin/nbd.ko ../prjs/ko/nbd.ko
ev3duder up ins ../prjs/ko/ins
ev3duder exec 'rm ../prjs/ko/uf2d'
ev3duder up bin/uf2d ../prjs/ko/uf2d
#ev3duder exec 'echo . /mnt/ramdisk/prjs/ko/ins > /mnt/ramdisk/rc.local'

View File

@ -1,6 +0,0 @@
CFLAGS = -std=c99 -W -Wall
SRC = main.c fat.c
all:
gcc -DX86=1 -g $(CFLAGS) $(SRC) -o server86
arm-none-linux-gnueabi-gcc -Os -s $(CFLAGS) $(SRC) -o server

View File

@ -1,784 +0,0 @@
#define VENDOR_NAME "The LEGO Group"
#define PRODUCT_NAME "Mindstorms EV3"
#define VOLUME_LABEL "EV3"
#define INDEX_URL "https://makecode.com/lego"
#define BOARD_ID "LEGO-EV3-v0"
#define _XOPEN_SOURCE 500
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include <fcntl.h>
#include <time.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <string.h>
#include <errno.h>
#define max(a, b) \
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a > _b ? _a : _b; \
})
#define min(a, b) \
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})
#include "uf2.h"
#define DBG LOG
typedef struct {
uint8_t JumpInstruction[3];
uint8_t OEMInfo[8];
uint16_t SectorSize;
uint8_t SectorsPerCluster;
uint16_t ReservedSectors;
uint8_t FATCopies;
uint16_t RootDirectoryEntries;
uint16_t TotalSectors16;
uint8_t MediaDescriptor;
uint16_t SectorsPerFAT;
uint16_t SectorsPerTrack;
uint16_t Heads;
uint32_t HiddenSectors;
uint32_t TotalSectors32;
uint8_t PhysicalDriveNum;
uint8_t Reserved;
uint8_t ExtendedBootSig;
uint32_t VolumeSerialNumber;
char VolumeLabel[11];
uint8_t FilesystemIdentifier[8];
} __attribute__((packed)) FAT_BootBlock;
typedef struct {
char name[8];
char ext[3];
uint8_t attrs;
uint8_t reserved;
uint8_t createTimeFine;
uint16_t createTime;
uint16_t createDate;
uint16_t lastAccessDate;
uint16_t highStartCluster;
uint16_t updateTime;
uint16_t updateDate;
uint16_t startCluster;
uint32_t size;
} __attribute__((packed)) DirEntry;
typedef struct {
uint8_t seqno;
uint16_t name0[5];
uint8_t attrs;
uint8_t type;
uint8_t checksum;
uint16_t name1[6];
uint16_t startCluster;
uint16_t name2[2];
} __attribute__((packed)) VFatEntry;
STATIC_ASSERT(sizeof(DirEntry) == 32);
#define STR0(x) #x
#define STR(x) STR0(x)
const char infoUf2File[] = //
"UF2 Bootloader " UF2_VERSION "\r\n"
"Model: " PRODUCT_NAME "\r\n"
"Board-ID: " BOARD_ID "\r\n";
const char indexFile[] = //
"<!doctype html>\n"
"<html>"
"<body>"
"<script>\n"
"location.replace(\"" INDEX_URL "\");\n"
"</script>"
"</body>"
"</html>\n";
#define RESERVED_SECTORS 1
#define ROOT_DIR_SECTORS 4
#define SECTORS_PER_FAT ((NUM_FAT_BLOCKS * 2 + 511) / 512)
#define START_FAT0 RESERVED_SECTORS
#define START_FAT1 (START_FAT0 + SECTORS_PER_FAT)
#define START_ROOTDIR (START_FAT1 + SECTORS_PER_FAT)
#define START_CLUSTERS (START_ROOTDIR + ROOT_DIR_SECTORS)
#define ROOT_DIR_ENTRIES (ROOT_DIR_SECTORS * 512 / 32)
#define F_TEXT 1
#define F_UF2 2
#define F_DIR 4
#define F_CONT 8
static const FAT_BootBlock BootBlock = {
.JumpInstruction = {0xeb, 0x3c, 0x90},
.OEMInfo = "UF2 UF2 ",
.SectorSize = 512,
.SectorsPerCluster = 1,
.ReservedSectors = RESERVED_SECTORS,
.FATCopies = 2,
.RootDirectoryEntries = ROOT_DIR_ENTRIES,
.TotalSectors16 = NUM_FAT_BLOCKS - 2,
.MediaDescriptor = 0xF8,
.SectorsPerFAT = SECTORS_PER_FAT,
.SectorsPerTrack = 1,
.Heads = 1,
.ExtendedBootSig = 0x29,
.VolumeSerialNumber = 0x00420042,
.VolumeLabel = VOLUME_LABEL,
.FilesystemIdentifier = "FAT16 ",
};
int currCluster = 2;
struct FsEntry *rootDir;
struct ClusterData *firstCluster, *lastCluster;
typedef struct ClusterData {
int flags;
int numclusters;
struct stat st;
struct ClusterData *dnext;
struct ClusterData *cnext;
struct FsEntry *dirdata;
struct FsEntry *myfile;
char name[0];
} ClusterData;
typedef struct FsEntry {
int startCluster;
uint8_t attrs;
int size;
int numdirentries;
time_t ctime, mtime;
struct FsEntry *next;
struct ClusterData *data;
char fatname[12];
char vfatname[0];
} FsEntry;
struct DirMap {
const char *mapName;
const char *fsName;
};
struct DirMap dirMaps[] = { //
#ifdef X86
{"foo qux baz", "dirs/bar"}, //
{"foo", "dirs/foo"}, //
{"xyz", "dirs/bar2"}, //
#else
{"Projects", "/mnt/ramdisk/prjs/BrkProg_SAVE"},
{"SD Card", "/media/card/myapps"},
{"USB Stick", "/media/usb/myapps"},
#endif
{NULL, NULL}};
void timeToFat(time_t t, uint16_t *dateP, uint16_t *timeP) {
struct tm tm;
localtime_r(&t, &tm);
if (timeP)
*timeP = (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec / 2);
if (dateP)
*dateP = (max(0, tm.tm_year - 80) << 9) | ((tm.tm_mon + 1) << 5) | tm.tm_mday;
}
void padded_memcpy(char *dst, const char *src, int len) {
for (int i = 0; i < len; ++i) {
if (*src)
*dst = *src++;
else
*dst = ' ';
dst++;
}
}
char *expandMap(const char *mapName) {
static char mapbuf[300];
const char *rest = "";
for (int i = 0; i < (int)sizeof(mapbuf); ++i) {
char c = mapName[i];
if (c == '/' || c == 0) {
mapbuf[i] = 0;
rest = mapName + i;
break;
}
mapbuf[i] = c;
}
for (int i = 0; dirMaps[i].mapName; ++i) {
if (strcmp(dirMaps[i].mapName, mapbuf) == 0) {
strcpy(mapbuf, dirMaps[i].fsName);
strcat(mapbuf, rest);
return mapbuf;
}
}
return NULL;
}
ClusterData *mkClusterData(int namelen) {
ClusterData *c = malloc(sizeof(*c) + namelen + 1);
memset(c, 0, sizeof(*c) + namelen + 1);
return c;
}
ClusterData *readDir(const char *mapName) {
DIR *d = opendir(expandMap(mapName));
if (!d)
return NULL;
ClusterData *res = NULL;
for (;;) {
struct dirent *ent = readdir(d);
if (!ent)
break;
ClusterData *c = mkClusterData(strlen(mapName) + 1 + strlen(ent->d_name));
c->flags = F_UF2;
c->dnext = res;
sprintf(c->name, "%s/%s", mapName, ent->d_name);
int err = stat(expandMap(c->name), &c->st);
assert(err >= 0);
if (S_ISREG(c->st.st_mode) && strlen(c->name) < UF2_FILENAME_MAX) {
c->numclusters = (c->st.st_size + 255) / 256;
} else {
free(c);
continue;
}
res = c;
}
closedir(d);
return res;
}
int filechar(int c) {
if (!c)
return 0;
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') ||
strchr("_-", c);
}
void copyFsChars(char *dst, const char *src, int len) {
for (int i = 0; i < len; ++i) {
if (filechar(*src))
dst[i] = toupper(*src++);
else {
if (*src == '.')
src = "";
if (*src == 0)
dst[i] = ' ';
else
dst[i] = '_';
while (*src && !filechar(*src))
src++;
}
}
}
FsEntry *mkFsEntry(const char *name) {
int sz = sizeof(FsEntry) + strlen(name) + 1;
FsEntry *e = malloc(sz);
memset(e, 0, sz);
e->startCluster = currCluster;
e->next = NULL;
// +1 for final 0x0000, and +12 for alignment
e->numdirentries = 1 + (strlen(name) + 1 + 12) / 13;
strcpy(e->vfatname, name);
const char *src = name;
copyFsChars(e->fatname, src, 8);
while (*src && *src != '.')
src++;
if (*src == '.')
src++;
else
src = "";
copyFsChars(e->fatname + 8, src, 3);
return e;
}
void addClusterData(ClusterData *c, FsEntry *e) {
currCluster += c->numclusters;
if (firstCluster == NULL) {
firstCluster = c;
} else {
lastCluster->cnext = c;
}
lastCluster = c;
if (c->st.st_ctime)
e->ctime = min(e->ctime, c->st.st_ctime);
e->mtime = max(e->mtime, c->st.st_mtime);
c->myfile = e;
DBG("add cluster: flags=%d size=%d numcl=%d", c->flags, (int)c->st.st_size, c->numclusters);
}
FsEntry *addRootText(const char *filename, const char *contents) {
FsEntry *e = mkFsEntry(filename);
e->next = rootDir;
rootDir = e;
int sz = strlen(contents);
e->size = sz;
if (sz > 0) {
assert(sz <= 512);
ClusterData *c = mkClusterData(sz);
c->st.st_mtime = c->st.st_ctime = time(NULL);
c->flags = F_TEXT;
strcpy(c->name, contents);
c->st.st_size = sz;
c->numclusters = 1;
addClusterData(c, e);
}
return e;
}
int baseLen(const char *a) {
int len = 0;
while (*a && *a != '.') {
a++;
len++;
}
return len;
}
int nameMatches(const char *a, const char *b) {
for (;;) {
if ((*a == 0 || *a == '.') && (*b == 0 || *b == '.'))
return 1;
if (*a != *b)
return 0;
a++;
b++;
}
}
void setFatNames(FsEntry *dirent) {
for (FsEntry *p = dirent; p; p = p->next) {
// check for collisions
int k = 1;
retry:
for (FsEntry *o = dirent; o && o != p; o = o->next) {
if (strcmp(o->fatname, p->fatname) == 0) {
char buf[20];
sprintf(buf, "~%d", k++);
int len = strlen(buf);
memcpy(p->fatname + 8 - len, buf, len);
goto retry;
}
}
DBG("setname: %s [%s] cl=%s @ %d sz=%d dents=%d", p->vfatname, p->fatname,
p->data ? p->data->name : "(no data)", p->startCluster, p->size, p->numdirentries);
}
}
void addFullDir(const char *mapName) {
int numEntries = 0;
FsEntry *dirents = NULL;
time_t mtime = 0, ctime = 0;
for (ClusterData *cl = readDir(mapName); cl; cl = cl->dnext) {
if (cl->cnext || cl == lastCluster)
continue; // already done
// vfat entries
const char *filename = strchr(cl->name, '/') + 1;
int len = baseLen(filename) + 4;
char namebuf[len];
memcpy(namebuf, filename, len - 4);
strcpy(namebuf + len - 4, ".uf2");
assert(cl->flags & F_UF2);
FsEntry *fent = mkFsEntry(namebuf);
numEntries += fent->numdirentries;
fent->next = dirents;
fent->data = cl;
fent->size = cl->numclusters * 512;
dirents = fent;
addClusterData(cl, fent);
for (ClusterData *other = cl->dnext; other; other = other->dnext) {
if (nameMatches(cl->name, other->name)) {
other->flags |= F_CONT;
fent->size += other->numclusters * 512;
addClusterData(other, fent);
}
}
if (mtime == 0) {
mtime = fent->mtime;
ctime = fent->ctime;
} else {
mtime = max(mtime, fent->mtime);
ctime = min(ctime, fent->ctime);
}
}
setFatNames(dirents);
FsEntry *dent = mkFsEntry(mapName);
dent->data = mkClusterData(0);
dent->data->dirdata = dirents;
dent->data->numclusters = (numEntries + 16) / 16; // at least 1
addClusterData(dent->data, dent);
dent->mtime = mtime;
dent->ctime = ctime;
dent->next = rootDir;
dent->attrs = 0x10;
dent->data->flags = F_DIR;
rootDir = dent;
}
void setupFs() {
addRootText("info_uf2.txt", infoUf2File);
addRootText("index.html", indexFile);
for (int i = 0; dirMaps[i].mapName; ++i) {
addFullDir(dirMaps[i].mapName);
}
setFatNames(rootDir); // make names unique
FsEntry *e = addRootText(BootBlock.VolumeLabel, "");
e->numdirentries = 1;
e->attrs = 0x28;
}
#define WRITE_ENT(v) \
do { \
if (skip++ >= 0) \
*dest++ = v; \
if (skip >= 256) \
return; \
cl++; \
} while (0)
void readFat(uint16_t *dest, int skip) {
int cl = 0;
skip = -skip;
WRITE_ENT(0xfff0);
WRITE_ENT(0xffff);
for (ClusterData *c = firstCluster; c; c = c->cnext) {
for (int i = 0; i < c->numclusters - 1; i++)
WRITE_ENT(cl + 1);
if (c->cnext && c->cnext->flags & F_CONT)
WRITE_ENT(cl + 1);
else
WRITE_ENT(0xffff);
}
}
// note that ptr might be unaligned
const char *copyVFatName(const char *ptr, void *dest, int len) {
uint8_t *dst = dest;
for (int i = 0; i < len; ++i) {
if (ptr == NULL) {
*dst++ = 0xff;
*dst++ = 0xff;
} else {
*dst++ = *ptr;
*dst++ = 0;
if (*ptr)
ptr++;
else
ptr = NULL;
}
}
return ptr;
}
uint8_t fatChecksum(const char *name) {
uint8_t sum = 0;
for (int i = 0; i < 11; ++i)
sum = ((sum & 1) << 7) + (sum >> 1) + *name++;
return sum;
}
void readDirData(uint8_t *dest, FsEntry *dirdata, int blkno) {
DirEntry *d = (void *)dest;
int idx = blkno * -16;
for (FsEntry *e = dirdata; e; e = e->next) {
if (idx >= 16)
break;
// DBG("dir idx=%d %s", idx, e->vfatname);
for (int i = 0; i < e->numdirentries; ++i, ++idx) {
if (0 <= idx && idx < 16) {
if (i == e->numdirentries - 1) {
memcpy(d->name, e->fatname, 11);
d->attrs = e->attrs;
d->size = e->size;
d->startCluster = e->startCluster;
timeToFat(e->mtime, &d->updateDate, &d->updateTime);
timeToFat(e->ctime, &d->createDate, &d->createTime);
} else {
VFatEntry *f = (void *)d;
int seq = e->numdirentries - i - 2;
f->seqno = seq + 1; // they start at 1
if (i == 0)
f->seqno |= 0x40;
f->attrs = 0x0F;
f->type = 0x00;
f->checksum = fatChecksum(e->fatname);
f->startCluster = 0;
const char *ptr = e->vfatname + (13 * seq);
ptr = copyVFatName(ptr, f->name0, 5);
ptr = copyVFatName(ptr, f->name1, 6);
ptr = copyVFatName(ptr, f->name2, 2);
}
d++;
}
}
}
}
void readBlock(uint8_t *dest, int blkno) {
// DBG("readbl %d", blkno);
int blkno0 = blkno;
for (ClusterData *c = firstCluster; c; c = c->cnext) {
// DBG("off=%d sz=%d", blkno, c->numclusters);
if (blkno >= c->numclusters) {
blkno -= c->numclusters;
continue;
}
// DBG("readbl off=%d %p", blkno, c);
if (c->dirdata) {
readDirData(dest, c->dirdata, blkno);
} else if (c->flags & F_TEXT) {
strcpy((char *)dest, c->name);
} else if (c->flags & F_UF2) {
UF2_Block *bl = (void *)dest;
bl->magicStart0 = UF2_MAGIC_START0;
bl->magicStart1 = UF2_MAGIC_START1;
bl->magicEnd = UF2_MAGIC_END;
bl->flags = UF2_FLAG_FILE;
bl->blockNo = blkno0 - (c->myfile->startCluster - 2);
bl->numBlocks = c->myfile->size / 512;
bl->targetAddr = blkno * 256;
bl->payloadSize = 256;
bl->fileSize = c->st.st_size;
int fd = open(expandMap(c->name), O_RDONLY);
if (fd >= 0) {
lseek(fd, bl->targetAddr, SEEK_SET);
bl->payloadSize = read(fd, bl->data, 256);
close(fd);
} else {
bl->payloadSize = -1;
}
if (bl->payloadSize < 475 - strlen(c->name))
strcpy((char *)bl->data + bl->payloadSize, c->name);
}
return;
}
}
void read_block(uint32_t block_no, uint8_t *data) {
memset(data, 0, 512);
uint32_t sectionIdx = block_no;
if (block_no == 0) {
memcpy(data, &BootBlock, sizeof(BootBlock));
data[510] = 0x55;
data[511] = 0xaa;
// logval("data[0]", data[0]);
} else if (block_no < START_ROOTDIR) {
sectionIdx -= START_FAT0;
if (sectionIdx >= SECTORS_PER_FAT) // second copy of fat?
sectionIdx -= SECTORS_PER_FAT;
readFat((void *)data, sectionIdx * 256);
} else if (block_no < START_CLUSTERS) {
sectionIdx -= START_ROOTDIR;
readDirData(data, rootDir, sectionIdx);
} else {
sectionIdx -= START_CLUSTERS;
readBlock(data, sectionIdx);
}
}
char rbfPath[300];
uint8_t stopApp[] = {
0x05, 0x00, // size
0x00, 0x00, // seq. no.
0x3f, 0x3d, // usb magic,
0x02, // req. no.
};
uint8_t runStart[] = {0x00, 0x00, // size
0x00, 0x00, // seq. no.
0x00, 0x00, 0x08, // something
0xC0, 0x08, 0x82, 0x01, 0x00, 0x84};
uint8_t runEnd[] = {0x00, 0x60, 0x64, 0x03, 0x01, 0x60, 0x64, 0x00};
#define FEED_DATA _IOC(_IOC_WRITE, 't', 108, 1024)
void startRbf() {
char buf[1024];
memset(buf, 0, sizeof(buf));
memcpy(buf, stopApp, sizeof(stopApp));
int fd = open("/dev/lms_usbdev", O_RDWR);
ioctl(fd, FEED_DATA, buf);
usleep(500000);
int off = 0;
memcpy(buf + off, runStart, sizeof(runStart));
off += sizeof(runStart);
strcpy(buf + off, rbfPath);
off += strlen(rbfPath);
memcpy(buf + off, runEnd, sizeof(runEnd));
off += sizeof(runEnd);
off -= 2;
buf[0] = off & 0xff;
buf[1] = off >> 8;
ioctl(fd, FEED_DATA, buf);
close(fd);
}
#define MAX_BLOCKS 8000
typedef struct {
uint32_t numBlocks;
uint32_t numWritten;
uint8_t writtenMask[MAX_BLOCKS / 8 + 1];
} WriteState;
void restartProgram() {
if (!rbfPath[0])
exit(0);
startRbf();
exit(0); // causes parent to eject MSD etc
}
int numWrites = 0;
static WriteState wrState;
void write_block(uint32_t block_no, uint8_t *data) {
WriteState *state = &wrState;
UF2_Block *bl = (void *)data;
if (bl->magicStart0 == 0x20da6d81 && bl->magicStart1 == 0x747e09d4) {
DBG("restart req, #wr=%d", numWrites);
if (numWrites) {
exit(0);
}
return;
}
numWrites++;
if (!is_uf2_block(bl)) {
return;
}
(void)block_no;
bl->data[475] = 0; // make sure we have NUL terminator
char *fn0 = (char *)bl->data + bl->payloadSize;
int namelen = 0;
if (bl->payloadSize <= UF2_MAX_PAYLOAD) {
namelen = strlen(fn0);
}
if ((bl->flags & UF2_FLAG_FILE) && bl->fileSize <= UF2_MAX_FILESIZE &&
bl->targetAddr < bl->fileSize && 1 <= namelen && namelen <= UF2_FILENAME_MAX) {
char *firstSL = strchr(fn0, '/');
char *lastSL = strrchr(fn0, '/');
if (!lastSL)
lastSL = fn0;
else
lastSL++;
int baseLen = strlen(lastSL);
char fallback[strlen(dirMaps[0].fsName) + 1 + baseLen + 1];
sprintf(fallback, "%s/%s", dirMaps[0].fsName, lastSL);
char *fn = NULL;
if (firstSL && firstSL + 1 == lastSL)
fn = expandMap(fn0);
if (!fn)
fn = fallback;
char *p = strrchr(fn, '/');
*p = 0;
mkdir(fn, 0777);
*p = '/';
int fd = open(fn, O_WRONLY | O_CREAT, 0777);
if (fd < 0 && errno == ETXTBSY) {
unlink(fn);
fd = open(fn, O_WRONLY | O_CREAT, 0777);
}
if (fd >= 0) {
ftruncate(fd, bl->fileSize);
lseek(fd, bl->targetAddr, SEEK_SET);
// DBG("write %d bytes at %d to %s", bl->payloadSize, bl->targetAddr, fn);
write(fd, bl->data, bl->payloadSize);
close(fd);
if (strlen(fn) > 4 && !strcmp(fn + strlen(fn) - 4, ".rbf")) {
strcpy(rbfPath, fn);
}
}
}
if (state && bl->numBlocks) {
if (state->numBlocks != bl->numBlocks) {
if (bl->numBlocks >= MAX_BLOCKS || state->numBlocks)
state->numBlocks = 0xffffffff;
else
state->numBlocks = bl->numBlocks;
}
if (bl->blockNo < MAX_BLOCKS) {
uint8_t mask = 1 << (bl->blockNo % 8);
uint32_t pos = bl->blockNo / 8;
if (!(state->writtenMask[pos] & mask)) {
// logval("incr", state->numWritten);
state->writtenMask[pos] |= mask;
state->numWritten++;
DBG("write %d/%d #%d", state->numWritten, state->numBlocks, bl->blockNo);
}
if (state->numWritten >= state->numBlocks) {
restartProgram();
}
}
} else {
// TODO timeout for restart?
}
}

View File

@ -1,231 +0,0 @@
#define _GNU_SOURCE 1
#include <sys/types.h>
#include <linux/nbd.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdarg.h>
#include "uf2.h"
const char *dev_file = "/dev/nbd0";
#define NUM_BLOCKS NUM_FAT_BLOCKS
uint64_t ntohll(uint64_t a) {
return ((uint64_t)ntohl(a & 0xffffffff) << 32) | ntohl(a >> 32);
}
#define htonll ntohll
void mylog(const char *fmt, ...) {
va_list args;
char *p, *p2;
va_start(args, fmt);
vasprintf(&p, fmt, args);
vprintf(fmt, args);
va_end(args);
if (p[0] != '<')
asprintf(&p2, "<6>%s\n", p);
else
asprintf(&p2, "%s\n", p);
int len = strlen(p2);
#ifdef X86
write(2, p2, len);
#else
int fd = open("/dev/kmsg", O_WRONLY);
write(fd, p2, len);
close(fd);
#endif
free(p);
free(p2);
}
void readAll(int fd, void *dst, uint32_t length) {
while (length) {
int curr = read(fd, dst, length);
if (curr < 0)
FAIL("read failed on fd:%d", fd);
length -= curr;
dst = (char *)dst + curr;
}
}
void writeAll(int fd, void *dst, uint32_t length) {
while (length) {
int curr = write(fd, dst, length);
if (curr < 0)
FAIL("write failed on fd:%d", fd);
length -= curr;
dst = (char *)dst + curr;
}
}
int nbd;
int sock;
int sockets[2];
struct nbd_request request;
struct nbd_reply reply;
void nbd_ioctl(unsigned id, int arg) {
int err = ioctl(nbd, id, arg);
if (err < 0)
FAIL("ioctl(%ud) failed [%s]", id, strerror(errno));
}
void startclient() {
close(sockets[0]);
nbd_ioctl(NBD_SET_SOCK, sockets[1]);
nbd_ioctl(NBD_DO_IT, 0);
nbd_ioctl(NBD_CLEAR_QUE, 0);
nbd_ioctl(NBD_CLEAR_SOCK, 0);
exit(0);
}
void handleread(int off, int len) {
uint8_t buf[512];
LOG("read @%d len=%d", off, len);
reply.error = 0; // htonl(EPERM);
writeAll(sock, &reply, sizeof(struct nbd_reply));
for (int i = 0; i < len; ++i) {
read_block(off + i, buf);
writeAll(sock, buf, 512);
}
}
void handlewrite(int off, int len) {
uint8_t buf[512];
LOG("write @%d len=%d", off, len);
for (int i = 0; i < len; ++i) {
readAll(sock, buf, 512);
write_block(off + i, buf);
}
reply.error = 0;
writeAll(sock, &reply, sizeof(struct nbd_reply));
}
void setupFs();
void runNBD() {
setupFs();
int err = socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
assert(err >= 0);
nbd = open(dev_file, O_RDWR);
assert(nbd >= 0);
nbd_ioctl(BLKFLSBUF, 0);
nbd_ioctl(NBD_SET_BLKSIZE, 512);
nbd_ioctl(NBD_SET_SIZE_BLOCKS, NUM_BLOCKS);
nbd_ioctl(NBD_CLEAR_SOCK, 0);
if (!fork())
startclient();
int fd = open(dev_file, O_RDONLY);
assert(fd != -1);
close(fd);
close(sockets[1]);
sock = sockets[0];
reply.magic = htonl(NBD_REPLY_MAGIC);
reply.error = htonl(0);
for (;;) {
// nbd_ioctl(BLKFLSBUF, 0); // flush buffers - we don't want the kernel to cache the writes
int nread = read(sock, &request, sizeof(request));
if (nread < 0) {
FAIL("nbd read err %s", strerror(errno));
}
if (nread == 0)
return;
assert(nread == sizeof(request));
memcpy(reply.handle, request.handle, sizeof(reply.handle));
reply.error = htonl(0);
assert(request.magic == htonl(NBD_REQUEST_MAGIC));
uint32_t len = ntohl(request.len);
assert((len & 511) == 0);
len >>= 9;
uint64_t from = ntohll(request.from);
assert((from & 511) == 0);
from >>= 9;
switch (ntohl(request.type)) {
case NBD_CMD_READ:
handleread(from, len);
break;
case NBD_CMD_WRITE:
handlewrite(from, len);
break;
case NBD_CMD_DISC:
return;
default:
FAIL("invalid cmd: %d", ntohl(request.type));
}
}
}
void enableMSD(int enabled) {
#ifndef X86
int fd = open("/sys/devices/platform/musb_hdrc/gadget/lun0/active", O_WRONLY);
write(fd, enabled ? "1" : "0", 1);
close(fd);
#else
LOG("fake enable MSD: %d", enabled);
#endif
}
int main(int argc, char **argv) {
#ifndef X86
daemon(0, 1);
#endif
if (argc > 1)
dev_file = argv[1];
for (;;) {
pid_t child = fork();
if (child == 0) {
runNBD();
return 0;
}
sleep(1);
enableMSD(1);
int wstatus = 0;
waitpid(child, &wstatus, 0);
enableMSD(0); // force "eject"
if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus) != 0) {
LOG("abnormal child return, %d", child);
sleep(5);
} else {
sleep(2);
}
}
return 0;
}

View File

@ -1,46 +0,0 @@
#ifndef UF2_H
#define UF2_H 1
#include "uf2format.h"
#include <stdio.h>
#include <string.h>
#ifndef INDEX_URL
#define INDEX_URL "https://www.pxt.io/"
#endif
#define UF2_VERSION_BASE "v0.1.0"
// needs to be more than ~4200 and less than ~65000 (to force FAT16)
#define NUM_FAT_BLOCKS 65000
#define UF2_VERSION UF2_VERSION_BASE " F"
//! Static block size for all memories
#define UDI_MSC_BLOCK_SIZE 512L
void read_block(uint32_t block_no, uint8_t *data);
void write_block(uint32_t block_no, uint8_t *data);
#define CONCAT_1(a, b) a##b
#define CONCAT_0(a, b) CONCAT_1(a, b)
#define STATIC_ASSERT(e) enum { CONCAT_0(_static_assert_, __LINE__) = 1 / ((e) ? 1 : 0) }
extern const char infoUf2File[];
void readAll(int fd, void *dst, uint32_t length);
STATIC_ASSERT(sizeof(UF2_Block) == 512);
void mylog(const char *fmt, ...);
#define FAIL(args...) \
do { \
mylog("<4>" args); \
exit(1); \
} while (0)
#define LOG mylog
#endif

View File

@ -1,48 +0,0 @@
#ifndef UF2FORMAT_H
#define UF2FORMAT_H 1
#include <stdint.h>
#include <stdbool.h>
// All entries are little endian.
// if you increase that, you will also need to update the linker script file
#define APP_START_ADDRESS 0x00002000
#define UF2_MAGIC_START0 0x0A324655UL // "UF2\n"
#define UF2_MAGIC_START1 0x9E5D5157UL // Randomly selected
#define UF2_MAGIC_END 0x0AB16F30UL // Ditto
// If set, the block is "comment" and should not be flashed to the device
#define UF2_FLAG_NOFLASH 0x00000001
#define UF2_FLAG_FILE 0x00001000
#define UF2_FILENAME_MAX 150
#define UF2_MAX_PAYLOAD (476 - 10) // leaving some space for filename
// for this bootloader
#define UF2_MAX_FILESIZE (64 * 1024 * 1024)
typedef struct {
// 32 byte header
uint32_t magicStart0;
uint32_t magicStart1;
uint32_t flags;
uint32_t targetAddr;
uint32_t payloadSize;
uint32_t blockNo;
uint32_t numBlocks;
uint32_t fileSize;
// raw data, followed by filename (NUL-terminated) at payloadSize
uint8_t data[476];
// store magic also at the end to limit damage from partial block reads
uint32_t magicEnd;
} UF2_Block;
static inline bool is_uf2_block(void *data) {
UF2_Block *bl = (UF2_Block *)data;
return bl->magicStart0 == UF2_MAGIC_START0 && bl->magicStart1 == UF2_MAGIC_START1 &&
bl->magicEnd == UF2_MAGIC_END;
}
#endif

View File

@ -1,106 +0,0 @@
#ifndef UF2_HID_H
#define UF2_HID_H 1
#define HF2_CMD_BININFO 0x0001
// no arguments
#define HF2_MODE_BOOTLOADER 0x01
#define HF2_MODE_USERSPACE 0x02
struct HF2_BININFO_Result {
uint32_t mode;
uint32_t flash_page_size;
uint32_t flash_num_pages;
uint32_t max_message_size;
};
#define HF2_CMD_INFO 0x0002
// no arguments
// results is utf8 character array
#define HF2_CMD_RESET_INTO_APP 0x0003
// no arguments, no result
#define HF2_CMD_RESET_INTO_BOOTLOADER 0x0004
// no arguments, no result
#define HF2_CMD_START_FLASH 0x0005
// no arguments, no result
#define HF2_CMD_WRITE_FLASH_PAGE 0x0006
struct HF2_WRITE_FLASH_PAGE_Command {
uint32_t target_addr;
uint32_t data[0];
};
// no result
#define HF2_CMD_CHKSUM_PAGES 0x0007
struct HF2_CHKSUM_PAGES_Command {
uint32_t target_addr;
uint32_t num_pages;
};
struct HF2_CHKSUM_PAGES_Result {
uint16_t chksums[0 /* num_pages */];
};
#define HF2_CMD_READ_WORDS 0x0008
struct HF2_READ_WORDS_Command {
uint32_t target_addr;
uint32_t num_words;
};
struct HF2_READ_WORDS_Result {
uint32_t words[0 /* num_words */];
};
#define HF2_CMD_WRITE_WORDS 0x0009
struct HF2_WRITE_WORDS_Command {
uint32_t target_addr;
uint32_t num_words;
uint32_t words[0 /* num_words */];
};
// no result
#define HF2_CMD_DMESG 0x0010
// no arguments
// results is utf8 character array
typedef struct {
uint32_t command_id;
uint16_t tag;
uint8_t reserved0;
uint8_t reserved1;
union {
struct HF2_WRITE_FLASH_PAGE_Command write_flash_page;
struct HF2_WRITE_WORDS_Command write_words;
struct HF2_READ_WORDS_Command read_words;
struct HF2_CHKSUM_PAGES_Command chksum_pages;
};
} HF2_Command;
typedef struct {
uint16_t tag;
union {
struct {
uint8_t status;
uint8_t status_info;
};
uint16_t status16;
};
union {
struct HF2_BININFO_Result bininfo;
uint8_t data8[0];
uint16_t data16[0];
uint32_t data32[0];
};
} HF2_Response;
#define HF2_FLAG_SERIAL_OUT 0x80
#define HF2_FLAG_SERIAL_ERR 0xC0
#define HF2_FLAG_CMDPKT_LAST 0x40
#define HF2_FLAG_CMDPKT_BODY 0x00
#define HF2_FLAG_MASK 0xC0
#define HF2_SIZE_MASK 63
#define HF2_STATUS_OK 0x00
#define HF2_STATUS_INVALID_CMD 0x01
#endif

View File

@ -1,4 +1,3 @@
/// <reference path="../node_modules/pxt-core/typings/globals/node/index.d.ts"/>
/// <reference path="../node_modules/pxt-core/built/pxtlib.d.ts" />
import * as fs from 'fs';

View File

@ -1,4 +1,3 @@
/// <reference path="../node_modules/pxt-core/typings/globals/node/index.d.ts"/>
/// <reference path="../node_modules/pxt-core/built/pxtlib.d.ts" />
import * as path from "path";

View File

@ -8,6 +8,7 @@
"module": "commonjs",
"rootDir": ".",
"newLine": "LF",
"sourceMap": false
"sourceMap": false,
"types": ["node"]
}
}

View File

@ -3,9 +3,3 @@
## Reference #reference
* [Reference](/reference)
* [input](/reference/input)
* [light](/reference/light)
* [music](/reference/music)
* [pins](/reference/pins)
* [control](/reference/control)
* [serial](/reference/serial)

View File

@ -4,5 +4,12 @@ Here are some fun programs for your @boardname@!
## Fun stuff
Coming soon.
```codecard
[
{
"name": "Happy unhappy",
"description": "Keep your brick entertained and happy",
"url":"/examples/happy-unhappy",
"cardType": "example"
}]
```

View File

@ -0,0 +1,12 @@
# Happy unhappy
Use a touch sensor to make the brick happy.
```blocks
sensors.touchSensor1.onEvent(TouchSensorEvent.Pressed, function () {
brick.showImage(images.expressionsBigSmile)
})
sensors.touchSensor1.onEvent(TouchSensorEvent.Released, function () {
brick.showImage(images.expressionsSick)
})
```

47
docs/maker.md Normal file
View File

@ -0,0 +1,47 @@
# Maker Activites
These six activities require the LEGO® MINDSTORMS® Education EV3 Core Set (45544). Supporting materials for teachers and middle school students are provided, offering everything teachers and students need to explore their inner makers as they follow the design process to solve open-ended, themed challenges...
* [Download Curriculum Materials](https://education.lego.com/en-us/downloads/mindstorms-ev3)
## Activites
```codecard
[
{
"name": "Sound Machine",
"description": "Create instruments with your EV3 Brick!",
"url":"/maker/sound-machine",
"cardType": "example",
"imageUrl": "/static/maker/sound-machine.png"
},
{
"name": "Sound Of Color",
"description": "Play different sounds based on the color",
"url":"/maker/sound-of-color",
"cardType": "example",
"imageUrl": "/static/maker/sound-of-color.png"
},
{
"name": "Security Gadget",
"description": "Raise the alarm when your brick is lifted!",
"url":"/maker/security-gadget",
"cardType": "example",
"imageUrl": "/static/maker/security-gadget.png"
},
{
"name": "Intruder Detector",
"description": "Raise the alarm when an intruder sneaks in",
"url":"/maker/intruder-detector",
"cardType": "example",
"imageUrl": "/static/maker/intruder-detector.png"
},
{
"name": "Puppet",
"description": "Build an automated puppet",
"url":"/maker/puppet",
"cardType": "example",
"imageUrl": "/static/maker/puppet.png"
}
]
```

View File

@ -0,0 +1,11 @@
# Intruder Detector
This program will activate an alarm when an object moves in front of the Ultrasonic Sensor.
TODO support for event when value changes
```blocks
input.ultrasonic4.onObjectNear(function () {
music.playSoundUntilDone(music.sounds(Sounds.PowerUp))
})
```

17
docs/maker/puppet.md Normal file
View File

@ -0,0 +1,17 @@
# Puppet
Use this program with the Programmable Brick and Large Motor.
```blocks
loops.forever(function () {
output.largeMotorA.setPower(30)
output.largeMotorA.on(true)
loops.pause(100)
output.largeMotorA.on(false)
music.playSoundUntilDone(music.sounds(Sounds.PowerUp))
output.largeMotorA.setPower(-30)
output.largeMotorA.on(true)
loops.pause(100)
output.largeMotorA.on(false)
})
```

View File

@ -0,0 +1,9 @@
# Security Gadget
This program will activate an alarm when an object is lifted from the Touch Sensor.
```blocks
input.touchSensor1.onEvent(TouchSensorEvent.Released, function () {
music.playSoundUntilDone(music.sounds(Sounds.PowerUp))
})
```

View File

@ -0,0 +1,12 @@
# Sound Machine
This example program combined with the small model will make a beat and rhythm on any surface when the program is run.
```blocks
loops.forever(function () {
output.motorA.on(50)
loops.pause(200)
output.motorA.on(100)
loops.pause(200)
})
```

View File

@ -0,0 +1,15 @@
# Sound Of Color
This program will play different sounds when the wheel is rotated. The sound is determined by which color is placed in front of the color Sensor.
```blocks
input.color3.onColorDetected(ColorSensorColor.Blue, function () {
music.playTone(Note.G4, music.beat(BeatFraction.Half))
})
input.color3.onColorDetected(ColorSensorColor.Red, function () {
music.playTone(Note.C5, music.beat(BeatFraction.Half))
})
input.color3.onColorDetected(ColorSensorColor.Green, function () {
music.playTone(Note.D5, music.beat(BeatFraction.Half))
})
```

View File

@ -1,19 +1,8 @@
# Reference
```namespaces
input.onGesture(Gesture.Shake, () => {})
light.showRing('red red red red red red red red red red')
music.playTone(0, 0)
pins.pulseDuration()
control.runInBackground(() => {})
serial.writeLine("");
```
## See Also
[blocks](/blocks), [JavaScript](/javascript), [input](/reference/input), [light](/reference/light), [music](/reference/music),
[control](/reference/control), [pins](/reference/pins), [serial](/reference/serial)
```package
circuit-playground
```
[touch sensor](/reference/sensors/touch-sensor),
[color sensor](/reference/sensors/color-sensor)

BIN
docs/static/MC-LEGO-loader-eyes.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

30
docs/static/fonts/icons/iconfont.css vendored Normal file
View File

@ -0,0 +1,30 @@
@font-face {
font-family: "iconfont";
src: url("iconfont.eot?e05611aaee246c1da118a83eaf515de9?#iefix") format("embedded-opentype"),
url("iconfont.woff2?e05611aaee246c1da118a83eaf515de9") format("woff2"),
url("iconfont.woff?e05611aaee246c1da118a83eaf515de9") format("woff");
}
.icon {
line-height: 1;
}
.icon:before {
font-family: iconfont !important;
font-style: normal;
font-weight: normal !important;
vertical-align: top;
}
.icon-ultrasonic:before {
content: "\f101";
}
.icon-color:before {
content: "\f102";
}
.icon-touch:before {
content: "\f103";
}
.icon-gyro:before {
content: "\f104";
}

BIN
docs/static/fonts/icons/iconfont.eot vendored Normal file

Binary file not shown.

24
docs/static/fonts/icons/iconfont.svg vendored Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<font id="iconfont" horiz-adv-x="40">
<font-face font-family="iconfont"
units-per-em="40" ascent="40"
descent="0" />
<missing-glyph horiz-adv-x="0" />
<glyph glyph-name="ultrasonic"
unicode="&#xF101;"
horiz-adv-x="40" d=" M26.8 13H13.1C15.6 14.6 17 17.3 17 20.2C17 21.8 16.6 23.3 15.8 24.7S13.8 27 12.4 27.8H27.6C26.2 27 25.1 26.1 24.2 24.7S23 21.8 23 20.2C22.9 17.3 24.3 14.6 26.8 13L26.8 13L26.8 13z M8.6 12C4.1 12 0.4 15.7 0.4 20.2S4.1 28.4 8.6 28.4S16.8 24.7 16.8 20.2C16.7 15.7 13.1 12 8.6 12zM8.6 23.4C6.8 23.4 5.4 22 5.4 20.2S6.8 16.9 8.6 16.9S11.9 18.4 11.9 20.2S10.4 23.4 8.6 23.4z M31.4 12C26.9 12 23.2 15.7 23.2 20.2S26.9 28.4 31.4 28.4S39.6 24.7 39.6 20.2C39.5 15.7 35.9 12 31.4 12zM31.4 23.4C29.6 23.4 28.1 22 28.1 20.2S29.6 16.9 31.4 16.9S34.6 18.4 34.6 20.2S33.2 23.4 31.4 23.4z" />
<glyph glyph-name="color"
unicode="&#xF102;"
horiz-adv-x="43.35195530726257" d=" M38.7 -0.1H4.7C3.4 -0.1 2.5 0.6 2.5 1.5V6.8H0.9A0.9608938547486034 0.9608938547486034 0 0 0 0 7.7V31.5A0.9608938547486034 0.9608938547486034 0 0 0 0.9 32.4H2.5V38.4C2.5 39.3 3.6 40 4.7 40H38.7C40 40 40.9 39.3 40.9 38.4V32.4H42.5A0.9608938547486034 0.9608938547486034 0 0 0 43.4 31.5V7.8A0.9608938547486034 0.9608938547486034 0 0 0 42.5 6.9H40.9V1.6C41.1 0.7 40 -0.1 38.7 -0.1zM21.7 35.1A11.374301675977657 11.374301675977657 0 0 1 13.6 15.5A4.916201117318437 4.916201117318437 0 0 1 13.4 13.7A8.268156424581006 8.268156424581006 0 0 1 29.9 13.7A4.916201117318437 4.916201117318437 0 0 1 29.7 15.5A12.379888268156424 12.379888268156424 0 0 1 33.1 23.6A11.1731843575419 11.1731843575419 0 0 1 21.7 35.1zM41.6 18.3V10.9H42.5V18.3zM1.1 18.3V10.9H2V18.3zM41.6 28.6V21.2H42.5V28.6zM1.1 28.6V21.2H2V28.6z M21.9 7.4A6.480446927374302 6.480446927374302 0 0 0 15.4 13.9A9.497206703910615 9.497206703910615 0 0 0 15.9 16.3A9.87709497206704 9.87709497206704 0 0 0 12.3 23.9A9.608938547486035 9.608938547486035 0 0 0 31.5 23.9A9.87709497206704 9.87709497206704 0 0 0 27.9 16.3A8.022346368715086 8.022346368715086 0 0 0 28.4 13.9A6.703910614525141 6.703910614525141 0 0 0 21.9 7.4zM21.9 16.3A2.4581005586592184 2.4581005586592184 0 1 1 24.4 13.9A2.837988826815643 2.837988826815643 0 0 1 21.9 16.3zM21.9 27.7A4.46927374301676 4.46927374301676 0 1 1 26.4 23.2A4.804469273743018 4.804469273743018 0 0 1 21.9 27.7z" />
<glyph glyph-name="touch"
unicode="&#xF103;"
horiz-adv-x="40" d=" M34.3 3.3H4.9C3.8 3.3 2.8 3.9 2.8 4.8V9.3H1.5C1.1 9.3 0.7 9.7 0.7 10.1V30.5C0.7 30.9 1.1 31.3 1.5 31.3H2.8V36.6C2.8 37.4 3.7 38.1 4.9 38.1H16V36.6H22.7V38.1H34.2C35.3 38.1 36.3 37.5 36.3 36.6V31.3H37.6C37.9 31.3 38.3 30.9 38.3 30.5V10.1C38.3 9.7 37.9 9.3 37.6 9.3H36.3V4.8C36.3 3.9 35.3 3.3 34.3 3.3L34.3 3.3zM14.1 16.2C14.7 15.3 15.4 14.7 16.2 14.1V5.6H22.6V14.1C23.5 14.7 24.1 15.4 24.7 16.2H33.4V22.6H24.9C24.3 23.5 23.6 24.3 22.6 24.9V33.6H16.2V24.9C15.3 24.3 14.5 23.6 13.9 22.6H5.4V16.2H14.1L14.1 16.2zM36.6 19.2V13H37.4V19.2H36.6zM1.8 19.2V13H2.6V19.2H1.8zM36.6 28.1V21.9H37.4V28.1H36.6zM1.8 28.1V21.9H2.6V28.1H1.8zM19.4 15.4C18.8 15.4 18.5 15.4 18.1 15.6V17.1C18.1 17.5 17.9 17.7 17.5 17.7L17.5 17.7H16C15.8 18.1 15.6 18.6 15.6 19.2C15.6 19.8 15.6 20.3 16 20.7H17.3C18.1 20.7 18.1 21.6 18.1 21.6L18.1 21.6C18.1 21.8 18.1 22.4 18.1 22.9C18.5 23.1 19 23.1 19.4 23.1C20 23.1 20.5 23.1 21.1 22.9C21.1 22.5 21.1 22 21.1 21.6L21.1 21.6V21.4C21.1 21 21.3 20.8 21.7 20.8C21.7 20.8 21.7 20.8 21.9 20.8L21.9 20.8H23.4C23.8 20.4 23.8 19.9 23.8 19.3S23.6 18.2 23.4 17.8L23.4 17.8C23 17.8 22.5 17.6 22.1 17.6C21.7 17.6 21.3 17.4 21.3 17V15.5C20.7 15.3 20.4 15.3 19.8 15.3C19.4 15.4 19.4 15.4 19.4 15.4z" />
<glyph glyph-name="gyro"
unicode="&#xF104;"
horiz-adv-x="23.578015492438215" d=" M17 0H6.4A5.901881224640355 5.901881224640355 0 0 0 5.1 0.3H2.3A1.283659166359277 1.283659166359277 0 0 0 1 1.6V4.5H0.5A0.5016599040944301 0.5016599040944301 0 0 0 0 5V35.4A0.5016599040944301 0.5016599040944301 0 0 0 0.5 35.9H1V38.7A1.283659166359277 1.283659166359277 0 0 0 2.3 40H10.6V39.6H12.8V40H21.2A1.283659166359277 1.283659166359277 0 0 0 22.5 38.7V35.9H23.1A0.5016599040944301 0.5016599040944301 0 0 0 23.6 35.4V5.1A0.5016599040944301 0.5016599040944301 0 0 0 23.1 4.6H22.5V1.6A1.283659166359277 1.283659166359277 0 0 0 21.2 0.4H18.5C18.4 0.1 17.2 0 17 0zM6.2 34.5L3.7 33.8A1.0033198081888601 1.0033198081888601 0 0 1 3.4 33.7A0.2360752489856142 0.2360752489856142 0 0 1 3.3 33.5A0.20656584286241245 0.20656584286241245 0 0 1 3.4 33.3L4.1 32.8A7.657690888970861 7.657690888970861 0 0 1 3.1 30A8.51346366654371 8.51346366654371 0 0 1 4.8 23.5C5.8 24.2 6.5 24.7 6.5 24.7A7.377351530800443 7.377351530800443 0 0 0 5.4 26.9A6.300258207303577 6.300258207303577 0 0 0 6 31.8L6.5 31.5H6.5L6.6 31.5A0.3541128734784213 0.3541128734784213 0 0 1 6.8 31.4A0.17705643673921065 0.17705643673921065 0 0 1 7 31.5A0.6344522316488379 0.6344522316488379 0 0 1 7 32L6.2 34.5zM17.5 31.8H17.5A6.300258207303577 6.300258207303577 0 0 0 18 26.9A7.510143858354851 7.510143858354851 0 0 0 17 24.7L17.1 24.6L18.6 23.5A8.631501291036518 8.631501291036518 0 0 1 20.3 30A7.657690888970861 7.657690888970861 0 0 1 19.3 32.8L19.8 33.1L20 33.2A0.22132054592401326 0.22132054592401326 0 0 1 20.1 33.4A0.26558465510881596 0.26558465510881596 0 0 1 20 33.6A1.0033198081888601 1.0033198081888601 0 0 1 19.7 33.7L17.2 34.5S17.1 34.1 17 33.6S16.6 32.3 16.5 32A0.619697528587237 0.619697528587237 0 0 1 16.5 31.5A0.17705643673921065 0.17705643673921065 0 0 1 16.6 31.4A0.48690520103282936 0.48690520103282936 0 0 1 16.8 31.4L16.8 31.4L17.4 31.7zM11.7 30.6A1.9918849133161198 1.9918849133161198 0 1 1 13.7 28.6A1.9918849133161198 1.9918849133161198 0 0 1 11.7 30.6H11.7z" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
docs/static/fonts/icons/iconfont.ttf vendored Normal file

Binary file not shown.

BIN
docs/static/fonts/icons/iconfont.woff vendored Normal file

Binary file not shown.

BIN
docs/static/fonts/icons/iconfont.woff2 vendored Normal file

Binary file not shown.

BIN
docs/static/hero.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

74
docs/static/lego-logo.svg vendored Normal file
View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="141.73"
height="141.731"
viewBox="0 0 141.73 141.73101"
enable-background="new 0 0 265.365 141.732"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="lego-logo.svg"><metadata
id="metadata26"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs24" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1199"
inkscape:window-height="604"
id="namedview22"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="1.6520876"
inkscape:cx="101.03204"
inkscape:cy="98.819336"
inkscape:window-x="372"
inkscape:window-y="149"
inkscape:window-maximized="0"
inkscape:current-layer="g6" /><g
id="product_logo" /><g
id="guides" /><g
id="LEGO_LOGO_SMALL_RGB"><g
id="g6"><path
d="m 0.961,0.948 0,139.839 139.84,0 0,-139.839 -139.84,0 z"
id="path8"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
d="m 0.961,0.948 0,139.839 139.84,0 0,-139.839 -139.84,0 z m 130.536,58.127 c -0.23,4.356 -1.617,9.786 -2.839,13.414 -4.917,14.609 -10.618,23.666 -23.821,23.666 -3.887,0 -10.783,-1.031 -13.324,-7.947 l -0.602,-1.641 -1.082,1.371 C 85.7,93.168 79.564,96.186 72.998,96.217 67.96,96.24 63.912,94.553 61.293,91.334 l -0.718,-0.883 -0.765,0.844 c -2.797,3.088 -7.668,4.859 -13.364,4.859 -4.473,0 -8.335,-1.521 -10.876,-4.277 l -0.692,-0.752 -0.72,0.727 c -2.825,2.852 -7.276,4.289 -12.873,4.158 -6.79,-0.162 -10.924,-3.951 -11.058,-10.141 -0.205,-9.543 9.031,-29.622 12.854,-35.727 2.482,-4.078 5.895,-6.055 10.438,-6.055 3.092,0 5.207,0.646 6.463,1.977 1.144,1.211 1.37,2.232 1.472,4.688 l 0.131,3.175 1.676,-2.7 c 4.054,-6.532 10.773,-7.434 17.43,-7.434 4.628,0 8.667,1.702 10.289,4.336 l 0.599,0.971 0.866,-0.737 c 3.431,-2.916 8.271,-4.521 13.629,-4.521 5.849,0 10.099,1.454 12.634,4.322 0.576,0.651 0.957,1.106 1.486,2.219 l 0.651,1.366 0.977,-1.155 c 3.712,-4.39 8.779,-6.615 15.067,-6.615 4.98,0 8.761,1.324 11.235,3.935 3.104,3.271 3.547,7.875 3.373,11.161 z"
id="path10"
inkscape:connector-curvature="0"
style="fill:#f6ec36" /><path
d="m 0.961,0.948 0,139.839 139.84,0 0,-139.839 -139.84,0 z M 135.435,64.44 c -0.633,5.089 -4.072,14.518 -5.899,18.286 -4.903,10.102 -11.453,17.863 -24.074,17.863 -6.742,0 -12.288,-2.15 -15.531,-6.283 -4.749,4.162 -10.627,6.342 -16.956,6.342 -4.876,0 -9.185,-1.408 -12.471,-4.012 -3.626,2.555 -8.52,3.98 -13.943,3.98 -4.53,0 -8.606,-1.244 -11.796,-3.543 -3.529,2.342 -8.154,3.506 -13.583,3.377 C 12.149,100.237 5.912,94.507 5.733,86.188 5.497,75.137 14.803,54.911 19.189,47.907 c 3.282,-5.392 8.292,-8.293 14.431,-8.293 6.663,0 9.078,1.903 10.267,4.326 5.141,-4.366 11.956,-4.617 16.808,-4.617 5.356,0 8.717,1.422 11.575,3.697 3.948,-2.368 8.477,-3.599 13.871,-3.599 6.897,0 12.021,1.604 15.595,5.137 4.168,-3.469 9.388,-5.05 15.23,-5.05 7.725,0 12.808,2.786 15.793,6.94 4.203,5.859 3.451,11.757 2.676,17.992 z"
id="path12"
inkscape:connector-curvature="0"
style="fill:#d01012" /><path
d="m 0,0 0,141.731 141.73,0 L 141.73,0 0,0 Z m 139.781,1.952 0,137.832 -137.83,0 0,-137.832 137.83,0 z"
id="path14"
inkscape:connector-curvature="0" /><path
d="m 134.752,42.53 0,-0.965 0.655,0 c 0.479,0 0.728,0.168 0.728,0.479 0,0.247 -0.16,0.486 -0.647,0.486 l -0.736,0 z m 2.351,2.002 -0.408,-0.708 c -0.354,-0.619 -0.452,-0.717 -0.755,-0.823 l 0,-0.019 c 0.596,-0.07 0.95,-0.453 0.95,-0.983 0,-0.56 -0.354,-0.984 -1.109,-0.984 l -1.754,0 0,3.519 0.727,0 0,-1.441 0.133,0 c 0.311,0 0.435,0.035 0.576,0.176 0.142,0.144 0.354,0.443 0.479,0.69 l 0.284,0.575 0.877,-0.002 0,0 z m -1.731,-4.497 c 1.51,0 2.737,1.218 2.737,2.726 0,1.508 -1.229,2.731 -2.737,2.731 -1.506,0 -2.72,-1.225 -2.72,-2.731 0,-1.506 1.214,-2.726 2.72,-2.726 z m 0,-0.67 c -1.877,0 -3.392,1.516 -3.392,3.396 0,1.879 1.515,3.394 3.392,3.394 1.883,0 3.397,-1.515 3.397,-3.394 0.002,-1.882 -1.514,-3.396 -3.397,-3.396 z"
id="path16"
inkscape:connector-curvature="0" /><path
d="m 116.889,43.002 c -7.325,0 -12.386,2.904 -15.812,6.961 -0.579,-1.214 -1.019,-1.746 -1.638,-2.447 -2.805,-3.17 -7.313,-4.649 -13.364,-4.649 -5.912,0 -10.841,1.846 -14.263,4.754 -1.777,-2.89 -6.013,-4.803 -11.121,-4.803 -6.674,0 -13.946,0.944 -18.261,7.896 -0.104,-2.503 -0.33,-3.828 -1.737,-5.317 -1.71,-1.81 -4.477,-2.282 -7.173,-2.282 -4.912,0 -8.605,2.146 -11.266,6.515 -3.859,6.163 -13.212,26.441 -13.001,36.263 0.137,6.344 4.393,10.916 12.01,11.096 5.952,0.143 10.62,-1.449 13.59,-4.447 2.665,2.896 6.731,4.594 11.596,4.594 5.417,0 10.868,-1.627 14.088,-5.182 2.712,3.332 6.979,5.271 12.468,5.244 7.175,-0.035 13.477,-3.438 17.593,-8.652 2.259,6.148 7.985,8.59 14.241,8.59 13.709,0 19.729,-9.428 24.748,-24.332 1.13,-3.357 2.639,-8.963 2.889,-13.672 0.413,-7.839 -2.903,-16.13 -15.587,-16.13 z M 25.672,80.477 c 7.093,-1.232 8.876,1.332 8.653,3.707 -0.669,7.109 -7.191,8.699 -12.854,8.566 -4.107,-0.1 -7.8,-1.98 -7.903,-6.748 -0.18,-8.342 8.328,-27.641 12.333,-34.038 1.85,-3.037 4.104,-4.539 7.698,-4.539 3.406,0 4.25,1.749 4.2,3.844 -0.134,5.589 -9.164,22.574 -12.127,29.208 z M 48.77,73.925 c -0.469,1.27 -1.357,3.93 -2.076,6.75 2.328,-0.582 4.074,-0.986 7.065,-0.914 3.408,0.084 5.586,1.496 5.586,4.314 0,6.832 -7.551,8.838 -12.789,8.838 -5.751,0 -10.803,-3.275 -10.803,-9.564 0,-7.373 3.997,-18.553 7.748,-26.001 4.606,-9.146 9.312,-10.362 17.419,-10.362 3.562,0 7.667,1.524 7.667,4.888 0,4.662 -3.95,6.44 -7.866,6.665 -1.672,0.096 -4.246,0.188 -5.786,0.079 0,0 -1.303,1.985 -2.688,5.523 7.252,-1.021 10.327,0.625 9.103,4.82 -1.657,5.667 -6.567,6.04 -12.58,4.964 z M 84.438,56.293 c -1.961,0 -3.244,1.242 -4.198,2.583 -2.102,2.952 -6.656,14.781 -7.365,19.64 -0.486,3.328 0.951,4.006 2.522,4.006 2.52,0 5.345,-2.666 6.309,-7.064 0,0 -4.797,-0.117 -3.475,-4.371 1.285,-4.128 3.723,-5.022 7.764,-5.188 7.961,-0.325 7.175,5.553 6.538,8.688 -2.069,10.18 -9.314,18.355 -19.562,18.355 -7.016,0 -11.371,-3.881 -11.371,-11.035 0,-5.098 2.529,-13.101 4.534,-17.784 4.267,-9.968 8.742,-16.944 20.143,-16.944 6.84,0 12.235,2.458 11.444,8.866 -0.58,4.703 -2.934,7.465 -7.21,7.799 -1.196,0.093 -6.089,-0.031 -4.466,-4.66 0.565,-1.619 0.799,-2.891 -1.607,-2.891 z m 43.057,8.413 c -1.205,6.002 -3.916,13.101 -6.859,18.392 -4.801,8.633 -10.633,9.842 -15.723,9.781 -5.093,-0.061 -10.83,-1.941 -10.874,-9.795 -0.031,-5.639 2.401,-13.598 4.466,-18.815 3.599,-9.458 7.277,-17.17 18.904,-17.031 13.559,0.161 11.141,12.219 10.086,17.468 z M 115.993,56.49 c -1.164,-0.016 -2.18,0.212 -3.093,1.62 -2.051,2.657 -8.047,19.042 -7.941,22.31 0.038,1.174 0.687,2.201 2.133,2.201 1.659,0.002 2.581,-1.145 3.396,-2.529 1.887,-3.193 7.193,-17.676 7.339,-21.297 0.043,-1.055 -0.133,-2.284 -1.834,-2.305 z"
id="path18"
inkscape:connector-curvature="0" /></g></g></svg>

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
docs/static/lego_education_logo.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
docs/static/maker/intruder-detector.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
docs/static/maker/puppet.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

BIN
docs/static/maker/security-gadget.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/static/maker/sound-machine.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

BIN
docs/static/maker/sound-of-color.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

47
docs/tests/motors.md Normal file
View File

@ -0,0 +1,47 @@
```typescript
tests.test("lgB set speed 10", () => {
motors.largeB.setSpeed(10);
loops.pause(100)
tests.assertClose("speedB", 10, motors.largeB.speed(), 2)
});
tests.test("lgB set speed 25 (reversed)", () => {
motors.largeB.setReversed(true)
motors.largeB.setSpeed(25)
loops.pause(100)
tests.assertClose("speedB", -25, motors.largeB.speed(), 2)
});
tests.test("lgBC set speed 5", () => {
motors.largeBC.setSpeed(5)
loops.pause(100)
tests.assertClose("speedB", 5, motors.largeB.speed(), 1);
tests.assertClose("speedC", 5, motors.largeC.speed(), 1);
});
tests.test("lgBC steer 50% 2x", () => {
motors.largeBC.setBrake(true)
motors.largeBC.steer(50, 50, 1, MoveUnit.Rotations)
loops.pause(1000)
tests.assertClose("largeB", 360, motors.largeB.angle(), 5)
motors.largeBC.setBrake(false)
})
tests.test("lgBC steer 50% 500deg", () => {
motors.largeBC.setBrake(true)
motors.largeBC.steer(50, 50, 135, MoveUnit.Degrees)
loops.pause(1000)
tests.assertClose("largeB", 135, motors.largeB.angle(), 5)
});
tests.test("lgBC steer 50% 2s", () => {
motors.largeBC.setBrake(true)
motors.largeBC.steer(50, 50, 500, MoveUnit.MilliSeconds)
loops.pause(1000)
})
tests.test("lgBC tank 50% 720deg", () => {
motors.largeBC.setBrake(true)
motors.largeBC.tank(50, 50, 180, MoveUnit.Degrees)
loops.pause(1000)
tests.assertClose("largeB", 180, motors.largeB.angle(), 5)
});
```
```package
tests
```

View File

@ -9,6 +9,13 @@ eval("if (typeof process === 'object' && process + '' === '[object process]') px
namespace pxt.editor {
import UF2 = pxtc.UF2;
export let ev3: Ev3Wrapper
export function debug() {
return initAsync()
.then(w => w.downloadFileAsync("/tmp/dmesg.txt", v => console.log(pxt.Util.uint8ArrayToString(v))))
}
// this comes from aux/pxt.lms
const rbfTemplate = `
4c45474f580000006d000100000000001c000000000000000e000000821b038405018130813e8053
@ -19,6 +26,7 @@ namespace pxt.editor {
return pxt.HF2.mkPacketIOAsync()
.then(h => {
let w = new Ev3Wrapper(h)
ev3 = w
return w.reconnectAsync(true)
.then(() => w)
})
@ -28,13 +36,33 @@ namespace pxt.editor {
let initPromise: Promise<Ev3Wrapper>
function initAsync() {
if (!initPromise)
if (initPromise)
return initPromise
let canHID = false
if (U.isNodeJS) {
canHID = true
} else {
const forceHexDownload = /forceHexDownload/i.test(window.location.href);
if (Cloud.isLocalHost() && Cloud.localToken && !forceHexDownload)
canHID = true
}
if (noHID)
canHID = false
if (canHID) {
initPromise = hf2Async()
.catch(err => {
initPromise = null
noHID = true
return Promise.reject(err)
})
} else {
noHID = true
initPromise = Promise.reject(new Error("no HID"))
}
return initPromise
}
@ -116,13 +144,9 @@ namespace pxt.editor {
const res: pxt.editor.ExtensionResult = {
deployCoreAsync,
};
initAsync()
/*
.then(w => w.streamFileAsync("/tmp/serial.txt", buf => {
let str = Util.fromUTF8(Util.uint8ArrayToString(buf))
}))
*/
initAsync().catch(e => {
// probably no HID - we'll try this again upon deployment
})
return Promise.resolve<pxt.editor.ExtensionResult>(res);
}
}

View File

@ -252,6 +252,13 @@ namespace pxt.editor {
return loop()
}
downloadFileAsync(path: string, cb: (d: Uint8Array) => void) {
return this.lock.enqueue("file", () =>
this.streamFileOnceAsync(path, cb))
}
private initAsync() {
return Promise.resolve()
}

Binary file not shown.

View File

@ -0,0 +1,193 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1344 8191 55 41">
<defs>
<style>
.cls-1 {
fill: #fff;
}
.cls-2 {
fill: #a8a9a8;
}
.cls-3 {
clip-path: url(#clip-path);
}
.cls-4 {
clip-path: url(#clip-path-2);
}
.cls-5 {
fill: #919191;
}
.cls-6 {
clip-path: url(#clip-path-3);
}
.cls-7 {
fill: #f2f2f2;
}
.cls-8 {
clip-path: url(#clip-path-4);
}
.cls-9 {
fill: #6a6a6a;
}
.cls-10 {
fill: #9a9a9a;
}
.cls-11 {
fill: #d02e26;
}
.cls-12 {
fill: #242424;
}
.cls-13 {
filter: url(#rød);
}
.cls-14 {
filter: url(#Path_4);
}
.cls-15 {
filter: url(#Path_1-2);
}
.cls-16 {
filter: url(#Path_2);
}
.cls-17 {
filter: url(#Path_1);
}
.cls-18 {
filter: url(#Path_34);
}
</style>
<clipPath id="clip-path">
<rect id="Rectangle_119" data-name="Rectangle 119" class="cls-1" width="55" height="41" transform="translate(-10.923 65.26)"/>
</clipPath>
<clipPath id="clip-path-2">
<path id="Union_6" data-name="Union 6" class="cls-2" d="M0,88.889A11.109,11.109,0,0,1,9.191,77.947L8.954,77.7,8.947,54.41c0-.273.093-.261.255-.438l7.1-6.846V40.6l-.488-.5v-.516H11.39a2.6,2.6,0,0,1-2.6-2.6V20.163a2.6,2.6,0,0,1,2.6-2.6h4.421V12.236a3.765,3.765,0,0,1,3.766-3.765h4.241c0-.059-.005-.117-.005-.176V3.941a3,3,0,0,1,1.882-2.785V.4a.4.4,0,0,1,.4-.4H43.183a.394.394,0,0,1,.394.4v1a3,3,0,0,1,1.412,2.546V8.294c0,.059,0,.118-.005.176h2.359a3.765,3.765,0,0,1,3.765,3.765V31.528c-6.749,9.152-11.8,15.533-11.8,15.533h-.387s-4.616-.035-8.906-.062l.022,7.681h4.479a2.6,2.6,0,0,1,2.6,2.6V74.093a2.6,2.6,0,0,1-2.6,2.6H30.1l.022,7.664c0,.545-.1.545-.3.74l-6.78,6.569-.139.124a.989.989,0,0,1-1.036-.154A11.108,11.108,0,0,1,0,88.889Z"/>
</clipPath>
<filter id="Path_34" x="1375.234" y="8125.181" width="24.177" height="13.354" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.5" result="blur"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur"/>
<feComposite in="SourceGraphic"/>
</filter>
<filter id="Path_1" x="1360.37" y="8169.796" width="24.177" height="49.327" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.5" result="blur-2"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur-2"/>
<feComposite in="SourceGraphic"/>
</filter>
<filter id="Path_2" x="1367.722" y="8164.375" width="16.687" height="17.582" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.5" result="blur-3"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur-3"/>
<feComposite in="SourceGraphic"/>
</filter>
<filter id="Path_1-2" x="1367.234" y="8132.71" width="38.296" height="41.59" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.5" result="blur-4"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur-4"/>
<feComposite in="SourceGraphic"/>
</filter>
<clipPath id="clip-path-3">
<path id="Path_9" data-name="Path 9" class="cls-2" d="M3.765,0H31.531A3.765,3.765,0,0,1,35.3,3.765V23.057C28.547,32.209,23.5,38.59,23.5,38.59h-.387s-12.667-.1-15.533-.1a1.484,1.484,0,0,1-1.548-.641L0,31.62V3.765A3.765,3.765,0,0,1,3.765,0Z"/>
</clipPath>
<filter id="Path_4" x="1370.999" y="8136.004" width="30.766" height="34.531" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.5" result="blur-5"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur-5"/>
<feComposite in="SourceGraphic"/>
</filter>
<clipPath id="clip-path-4">
<path id="Path_10" data-name="Path 10" class="cls-2" d="M3.765,0H24a3.765,3.765,0,0,1,3.765,3.765v14.48c-5.628,7.331-10.127,13.286-10.127,13.286H3.765A3.765,3.765,0,0,1,0,27.766v-24A3.765,3.765,0,0,1,3.765,0Z"/>
</clipPath>
<filter id="rød" x="1351.423" y="8202.021" width="25.213" height="25.214" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.5" result="blur-6"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur-6"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<g id="icn_block_Large_motor" transform="translate(666.315 8209.204)">
<g id="Symbol_13_1" data-name="Symbol 13 1" transform="translate(688.608 -83.464)">
<g id="Mask_Group_12" data-name="Mask Group 12" class="cls-3">
<g id="Mask_Group_6" data-name="Mask Group 6" class="cls-4" transform="translate(-2)">
<g id="Large_motor" data-name="Large motor" transform="translate(-1.056 0)">
<g id="Group_23" data-name="Group 23">
<path id="Subtraction_1" data-name="Subtraction 1" class="cls-5" d="M-2806.659-5548.724h-3.653a3.558,3.558,0,0,1-3.554-3.554v-14.908a3.558,3.558,0,0,1,3.554-3.555h3.653a3.558,3.558,0,0,1,3.554,3.555v14.908A3.558,3.558,0,0,1-2806.659-5548.724Zm.1-5.923a2.47,2.47,0,0,0-2.468,2.467,2.471,2.471,0,0,0,2.468,2.469,2.471,2.471,0,0,0,2.468-2.469A2.47,2.47,0,0,0-2806.56-5554.647Zm.062-.99h.01a2.859,2.859,0,0,1,1.425.37c.112.054.238.116.378.176a.67.67,0,0,0,.267.063c.364,0,.427-.425.428-.429v-1.145s-.111-.449-.454-.449a.556.556,0,0,0-.241.063l-.211.1a2.988,2.988,0,0,1-1.591.4h-.023a4.281,4.281,0,0,1-1.831-.5.642.642,0,0,0-.262-.059c-.167,0-.392.077-.517.444,0,0-.011.628,0,1.145.007.32.3.388.537.388a1.414,1.414,0,0,0,.239-.021A4.678,4.678,0,0,1-2806.5-5555.637Zm-1.218-3.3h.006c.048,0,.469.012.469.422v.844s.136.2.639.2c.039,0,.079,0,.123,0a2.375,2.375,0,0,0,.914-.2v-.844a.437.437,0,0,1,.429-.422c.145,0,.287,0,.394,0,.22,0,.391,0,.42,0,.005,0,.168-.134.19-.861.021-.7-.165-.883-.186-.9h-.818c-.022,0-.524-.049-.532-.5-.006-.386,0-1.306,0-1.684v-.022a.326.326,0,0,1,.048-.21.1.1,0,0,1,.076-.033.219.219,0,0,1,.093.025l.79.379a.668.668,0,0,0,.256.062.255.255,0,0,0,.189-.07.4.4,0,0,0,.084-.292c-.008-.485,0-1.013,0-1.163v-.008a.214.214,0,0,0-.215-.179.654.654,0,0,0-.315.111,2.7,2.7,0,0,1-1.524.458c-.075.006-.151.009-.224.009a3.3,3.3,0,0,1-1.72-.468,1.044,1.044,0,0,0-.545-.253.225.225,0,0,0-.167.065.4.4,0,0,0-.087.255v1.171a.423.423,0,0,0,.451.4.709.709,0,0,0,.349-.1c.357-.2.564-.326.633-.366l.022-.013a.216.216,0,0,1,.088-.021c.067,0,.147.042.147.238v1.706a.578.578,0,0,1-.138.378.427.427,0,0,1-.319.121h-.018c-.136,0-.288,0-.449,0-.219,0-.384,0-.445,0,0,0-.2.165-.2.9,0,.717.184.855.192.861Zm1.156-10.815a2.471,2.471,0,0,0-2.468,2.469,2.47,2.47,0,0,0,2.468,2.467,2.47,2.47,0,0,0,2.468-2.467A2.471,2.471,0,0,0-2806.56-5569.753Z" transform="translate(2841.282 5625.42)"/>
</g>
<path id="Path_36" data-name="Path 36" class="cls-2" d="M.395,0H17.488a.4.4,0,0,1,.395.395V3.841a.4.4,0,0,1-.395.395H.395A.4.4,0,0,1,0,3.841V.395A.4.4,0,0,1,.395,0Z" transform="translate(26.751 0)"/>
<g class="cls-18" transform="matrix(1, 0, 0, 1, -1351.87, -8125.74)">
<path id="Path_34-2" data-name="Path 34" class="cls-2" d="M.395,0H20.782a.4.4,0,0,1,.395.395V9.958a.4.4,0,0,1-.395.395H.395A.4.4,0,0,1,0,9.958V.395A.4.4,0,0,1,.395,0Z" transform="translate(1376.73 8126.68)"/>
</g>
<g class="cls-17" transform="matrix(1, 0, 0, 1, -1351.87, -8125.74)">
<path id="Path_1-3" data-name="Path 1" class="cls-5" d="M-.121,4,8.6-4.416,20.69-3.98,20.8,34.388c0,.545-.1.545-.3.74l-6.78,6.57-.138.124c-.38.26-1.293-.075-1.293-.62L-.368,27.722-.375,4.438C-.375,4.165-.283,4.176-.121,4Z" transform="translate(1362.25 8175.71)"/>
</g>
<g class="cls-16" transform="matrix(1, 0, 0, 1, -1351.87, -8125.74)">
<path id="Path_2-2" data-name="Path 2" class="cls-2" d="M1484.037,521.285v11.229s.012.55.2.729,2.289,2.36,2.289,2.36a1.019,1.019,0,0,0,.753.262c.493-.016,7.567,0,7.567,0l2.883-3.057v-5.183l-6.94-.369Z" transform="translate(-114.81 7644.59)"/>
</g>
<g id="Group_4" data-name="Group 4" transform="translate(9.843 17.559)">
<path id="Path_44" data-name="Path 44" class="cls-2" d="M3.554,0H7.207a3.554,3.554,0,0,1,3.554,3.554V18.462a3.554,3.554,0,0,1-3.554,3.554H3.554A3.554,3.554,0,0,1,0,18.462V3.554A3.554,3.554,0,0,1,3.554,0Z" transform="translate(0 0)"/>
<ellipse id="Ellipse_3" data-name="Ellipse 3" class="cls-1" cx="2.468" cy="2.468" rx="2.468" ry="2.468" transform="translate(0.691 0.987)"/>
<ellipse id="Ellipse_4" data-name="Ellipse 4" class="cls-1" cx="2.468" cy="2.468" rx="2.468" ry="2.468" transform="translate(0.691 16.092)"/>
<path id="Path_5" data-name="Path 5" class="cls-1" d="M5607.868,939.1a2.7,2.7,0,0,1-1.524.459,3.338,3.338,0,0,1-1.945-.459c-.818-.606-.8.067-.8.067v1.172c0,.293.36.55.8.3s.654-.378.654-.378.235-.12.235.218v1.705s.013.512-.475.5-.9,0-.9,0-.191.161-.191.9.191.86.191.86h.9s.475-.016.475.422v.844s.147.234.761.2a2.341,2.341,0,0,0,.914-.2v-.844a.436.436,0,0,1,.43-.422c.41-.006.818,0,.818,0s.164-.124.187-.86-.187-.9-.187-.9h-.818s-.524-.034-.533-.5,0-1.705,0-1.705-.03-.335.216-.218l.791.378s.541.265.53-.3,0-1.172,0-1.172S5608.345,938.813,5607.868,939.1Z" transform="translate(-5602.81 -932.641)"/>
<path id="Path_6" data-name="Path 6" class="cls-1" d="M5601.894,1015.1a.54.54,0,0,1,.778-.386,4.241,4.241,0,0,0,1.854.5,3.287,3.287,0,0,0,1.8-.5c.54-.263.695.386.695.386v1.145a.462.462,0,0,1-.695.365,3.768,3.768,0,0,0-1.8-.545,4.6,4.6,0,0,0-1.854.545s-.767.155-.778-.365S5601.894,1015.1,5601.894,1015.1Z" transform="translate(-5601.296 -1000.958)"/>
</g>
<g class="cls-15" transform="matrix(1, 0, 0, 1, -1351.87, -8125.74)">
<path id="Path_1-4" data-name="Path 1" class="cls-2" d="M3.765,0H31.531A3.765,3.765,0,0,1,35.3,3.765V23.057C28.547,32.209,23.5,38.59,23.5,38.59h-.387s-12.667-.1-15.533-.1a1.484,1.484,0,0,1-1.548-.641L0,31.62V3.765A3.765,3.765,0,0,1,3.765,0Z" transform="translate(1368.73 8134.21)"/>
</g>
<g id="hvid" transform="translate(16.868 8.471)">
<g id="Mask_Group_1" data-name="Mask Group 1" class="cls-6">
<path id="hvid-2" data-name="hvid" class="cls-7" d="M1498.578,448.445l4.657,4.8,15.484,20.229v9.67l8.5-10.5V452.321l-.646-5.006Z" transform="translate(-1491.247 -448.708)"/>
</g>
</g>
<g class="cls-14" transform="matrix(1, 0, 0, 1, -1351.87, -8125.74)">
<path id="Path_4-2" data-name="Path 4" class="cls-2" d="M3.765,0H24a3.765,3.765,0,0,1,3.765,3.765v14.48c-5.628,7.331-10.127,13.286-10.127,13.286H3.765A3.765,3.765,0,0,1,0,27.766v-24A3.765,3.765,0,0,1,3.765,0Z" transform="translate(1372.5 8137.51)"/>
</g>
<g id="Group_3" data-name="Group 3" transform="translate(20.633 11.963)">
<g id="Mask_Group_2" data-name="Mask Group 2" class="cls-8" transform="translate(0 0)">
<path id="Union_1" data-name="Union 1" class="cls-9" d="M9.412,18.589V.706a.706.706,0,1,1,1.412,0V18.589a.706.706,0,1,1-1.412,0Zm-2.353,0V.706a.706.706,0,1,1,1.412,0V18.589a.706.706,0,1,1-1.412,0Zm-2.353,0V.706a.706.706,0,1,1,1.412,0V18.589a.706.706,0,1,1-1.412,0Zm-2.353,0V.706a.706.706,0,1,1,1.412,0V18.589a.706.706,0,1,1-1.412,0ZM0,18.589V.706a.706.706,0,1,1,1.412,0V18.589a.706.706,0,1,1-1.412,0Z" transform="translate(10.353 -3.492)"/>
</g>
</g>
<ellipse id="Ellipse_1" data-name="Ellipse 1" class="cls-10" cx="1.461" cy="1.461" rx="1.461" ry="1.461" transform="translate(18.925 10.528)"/>
<ellipse id="Ellipse_2" data-name="Ellipse 2" class="cls-10" cx="1.461" cy="1.461" rx="1.461" ry="1.461" transform="translate(37.584 43.404)"/>
<g class="cls-13" transform="matrix(1, 0, 0, 1, -1351.87, -8125.74)">
<ellipse id="rød-2" data-name="rød" class="cls-11" cx="11.107" cy="11.107" rx="11.107" ry="11.107" transform="translate(1352.92 8203.52)"/>
</g>
<g id="Group_2" data-name="Group 2" transform="matrix(0.966, 0.259, -0.259, 0.966, 5.162, 76.726)">
<ellipse id="Ellipse_4-2" data-name="Ellipse 4" cx="2.468" cy="2.468" rx="2.468" ry="2.468" transform="translate(7.503 0)"/>
<ellipse id="Ellipse_7" data-name="Ellipse 7" cx="2.468" cy="2.468" rx="2.468" ry="2.468" transform="translate(15.006 7.503)"/>
<ellipse id="Ellipse_5" data-name="Ellipse 5" cx="2.468" cy="2.468" rx="2.468" ry="2.468" transform="translate(7.503 15.006)"/>
<ellipse id="Ellipse_6" data-name="Ellipse 6" cx="2.468" cy="2.468" rx="2.468" ry="2.468" transform="translate(0 7.503)"/>
<path id="Path_4-3" data-name="Path 4" class="cls-12" d="M1.564,1.019s.014.512-.475.5-.9,0-.9,0S0,1.68,0,2.421s.191.86.191.86h.9s.475-.016.475.422,0,.844,0,.844.147.234.761.2a2.339,2.339,0,0,0,.914-.2V3.7a.436.436,0,0,1,.43-.422c.41-.006.818,0,.818,0s.164-.124.187-.86-.187-.9-.187-.9H3.669s-.524-.034-.532-.5A8.122,8.122,0,0,1,3.179.2,1.884,1.884,0,0,0,1.646.138C1.595.533,1.564,1.019,1.564,1.019Z" transform="translate(7.602 12.277) rotate(-90)"/>
<path id="Path_5-2" data-name="Path 5" d="M.3.1,1.312,0,2.369.1a.3.3,0,0,1,.3.3V1.779a.3.3,0,0,1-.3.3L1.36,1.939.3,2.075a.3.3,0,0,1-.3-.3V.4A.3.3,0,0,1,.3.1Z" transform="translate(8.618 5.261)"/>
<path id="Path_7" data-name="Path 7" d="M.3.1,1.312,0,2.369.1a.3.3,0,0,1,.3.3V1.779a.3.3,0,0,1-.3.3L1.36,1.939.3,2.075a.3.3,0,0,1-.3-.3V.4A.3.3,0,0,1,.3.1Z" transform="translate(5.26 11.285) rotate(-90)"/>
<path id="Path_6-2" data-name="Path 6" d="M.3.1,1.312,0,2.369.1a.3.3,0,0,1,.3.3V1.779a.3.3,0,0,1-.3.3L1.36,1.939.3,2.075a.3.3,0,0,1-.3-.3V.4A.3.3,0,0,1,.3.1Z" transform="translate(11.284 14.642) rotate(180)"/>
<path id="Path_8" data-name="Path 8" d="M.3.1,1.312,0,2.369.1a.3.3,0,0,1,.3.3V1.779a.3.3,0,0,1-.3.3L1.36,1.939.3,2.075a.3.3,0,0,1-.3-.3V.4A.3.3,0,0,1,.3.1Z" transform="translate(14.641 8.619) rotate(90)"/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,35 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1321.124 9006.084 42.65 31.79">
<defs>
<style>
.cls-1 {
fill: #6a6a6a;
}
.cls-2 {
fill: url(#linear-gradient);
}
.cls-3 {
fill: #a8a9a8;
}
.cls-4 {
fill: #3c3c3c;
}
</style>
<linearGradient id="linear-gradient" x1="0.5" y1="0.948" x2="0.5" y2="0.059" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#6a6a6a"/>
<stop offset="0.522" stop-color="#8ce300"/>
<stop offset="1" stop-color="#6a6a6a"/>
</linearGradient>
</defs>
<g id="icn_block_buttons_green" transform="translate(666.315 8209.204)">
<path id="Union_4" data-name="Union 4" class="cls-1" d="M16.882,31.79c-3.635-3.509-9.28-9.28-9.28-9.28V21.325H5.38a5.381,5.381,0,0,1,0-10.761H7.6V9.379L16.783,0h9.182c4.158,4.237,9.182,9.182,9.182,9.182v1.382h2.122a5.381,5.381,0,1,1,0,10.761H35.147V22.51c-4.891,5.031-9.083,9.28-9.083,9.28Z" transform="translate(654.809 796.881)"/>
<path id="light" class="cls-2" d="M16.882,31.79c-3.635-3.509-9.28-9.28-9.28-9.28V21.325H5.38a5.381,5.381,0,0,1,0-10.761H7.6V9.379L16.783,0h9.182c4.158,4.237,9.182,9.182,9.182,9.182v1.382h2.122a5.381,5.381,0,1,1,0,10.761H35.147V22.51c-4.891,5.031-9.083,9.28-9.083,9.28Z" transform="translate(654.809 796.881)"/>
<path id="Rectangle_23" data-name="Rectangle 23" class="cls-3" d="M4,0h6.763a0,0,0,0,1,0,0V8a0,0,0,0,1,0,0H4A4,4,0,0,1,0,4V4A4,4,0,0,1,4,0Z" transform="translate(656.092 808.729)"/>
<path id="Rectangle_24" data-name="Rectangle 24" class="cls-3" d="M4,0h6.763a0,0,0,0,1,0,0V8a0,0,0,0,1,0,0H4A4,4,0,0,1,0,4V4A4,4,0,0,1,4,0Z" transform="translate(696.077 816.725) rotate(180)"/>
<path id="Path_42" data-name="Path 42" class="cls-4" d="M.3,0H8.1a.3.3,0,0,1,.3.3V7.7a.3.3,0,0,1-.3.3H.3A.3.3,0,0,1,0,7.7V.3A.3.3,0,0,1,.3,0Z" transform="translate(671.889 808.729)"/>
<path id="Path_15" data-name="Path 15" class="cls-3" d="M-102.228-1598.9l8.293-.1,6.22,6.417-2.567,2.567v4.64h-2.369v-2.666a1.99,1.99,0,0,0-1.975-1.974c-1.927-.031-7.207,0-7.207,0a1.606,1.606,0,0,0-1.678,1.678v2.962h-2.369v-4.64l-2.567-2.567Z" transform="translate(774.216 2397.264)"/>
<path id="Path_16" data-name="Path 16" class="cls-3" d="M6.264.062,14.505,0l6.236,6.412L18.135,8.954v4.667H15.79V10.945a2,2,0,0,0-1.969-1.99c-1.927-.031-7.166,0-7.166,0A1.689,1.689,0,0,0,4.93,10.679v2.942H2.543V8.954L0,6.412Z" transform="translate(686.509 827.175) rotate(180)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,35 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1321.124 8957.084 42.65 31.79">
<defs>
<style>
.cls-1 {
fill: #6a6a6a;
}
.cls-2 {
fill: url(#linear-gradient);
}
.cls-3 {
fill: #a8a9a8;
}
.cls-4 {
fill: #3c3c3c;
}
</style>
<linearGradient id="linear-gradient" x1="0.5" y1="0.948" x2="0.5" y2="0.059" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#6a6a6a"/>
<stop offset="0.522" stop-color="#e5352c"/>
<stop offset="1" stop-color="#6a6a6a"/>
</linearGradient>
</defs>
<g id="icn_block_buttons_red" transform="translate(666.315 8209.204)">
<path id="Union_4" data-name="Union 4" class="cls-1" d="M16.882,31.79c-3.635-3.509-9.28-9.28-9.28-9.28V21.325H5.38a5.381,5.381,0,0,1,0-10.761H7.6V9.379L16.783,0h9.182c4.158,4.237,9.182,9.182,9.182,9.182v1.382h2.122a5.381,5.381,0,1,1,0,10.761H35.147V22.51c-4.891,5.031-9.083,9.28-9.083,9.28Z" transform="translate(654.809 747.881)"/>
<path id="light" class="cls-2" d="M16.882,31.79c-3.635-3.509-9.28-9.28-9.28-9.28V21.325H5.38a5.381,5.381,0,0,1,0-10.761H7.6V9.379L16.783,0h9.182c4.158,4.237,9.182,9.182,9.182,9.182v1.382h2.122a5.381,5.381,0,1,1,0,10.761H35.147V22.51c-4.891,5.031-9.083,9.28-9.083,9.28Z" transform="translate(654.809 747.881)"/>
<path id="Rectangle_23" data-name="Rectangle 23" class="cls-3" d="M4,0h6.763a0,0,0,0,1,0,0V8a0,0,0,0,1,0,0H4A4,4,0,0,1,0,4V4A4,4,0,0,1,4,0Z" transform="translate(656.092 759.729)"/>
<path id="Rectangle_24" data-name="Rectangle 24" class="cls-3" d="M4,0h6.763a0,0,0,0,1,0,0V8a0,0,0,0,1,0,0H4A4,4,0,0,1,0,4V4A4,4,0,0,1,4,0Z" transform="translate(696.077 767.725) rotate(180)"/>
<path id="Path_42" data-name="Path 42" class="cls-4" d="M.3,0H8.1a.3.3,0,0,1,.3.3V7.7a.3.3,0,0,1-.3.3H.3A.3.3,0,0,1,0,7.7V.3A.3.3,0,0,1,.3,0Z" transform="translate(671.889 759.729)"/>
<path id="Path_15" data-name="Path 15" class="cls-3" d="M-102.228-1598.9l8.293-.1,6.22,6.417-2.567,2.567v4.64h-2.369v-2.666a1.99,1.99,0,0,0-1.975-1.974c-1.927-.031-7.207,0-7.207,0a1.606,1.606,0,0,0-1.678,1.678v2.962h-2.369v-4.64l-2.567-2.567Z" transform="translate(774.216 2348.264)"/>
<path id="Path_16" data-name="Path 16" class="cls-3" d="M6.264.062,14.505,0l6.236,6.412L18.135,8.954v4.667H15.79V10.945a2,2,0,0,0-1.969-1.99c-1.927-.031-7.166,0-7.166,0A1.689,1.689,0,0,0,4.93,10.679v2.942H2.543V8.954L0,6.412Z" transform="translate(686.509 778.175) rotate(180)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,35 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1393.124 8957.084 42.65 31.79">
<defs>
<style>
.cls-1 {
fill: #6a6a6a;
}
.cls-2 {
fill: url(#linear-gradient);
}
.cls-3 {
fill: #a8a9a8;
}
.cls-4 {
fill: #3c3c3c;
}
</style>
<linearGradient id="linear-gradient" x1="0.5" y1="0.948" x2="0.5" y2="0.059" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#6a6a6a"/>
<stop offset="0.522" stop-color="#ffeb00"/>
<stop offset="1" stop-color="#838383"/>
</linearGradient>
</defs>
<g id="icn_block_buttons_yellow" transform="translate(666.315 8209.204)">
<path id="Union_4" data-name="Union 4" class="cls-1" d="M16.882,31.79c-3.635-3.509-9.28-9.28-9.28-9.28V21.325H5.38a5.381,5.381,0,0,1,0-10.761H7.6V9.379L16.783,0h9.182c4.158,4.237,9.182,9.182,9.182,9.182v1.382h2.122a5.381,5.381,0,1,1,0,10.761H35.147V22.51c-4.891,5.031-9.083,9.28-9.083,9.28Z" transform="translate(726.809 747.881)"/>
<path id="light" class="cls-2" d="M16.882,31.79c-3.635-3.509-9.28-9.28-9.28-9.28V21.325H5.38a5.381,5.381,0,0,1,0-10.761H7.6V9.379L16.783,0h9.182c4.158,4.237,9.182,9.182,9.182,9.182v1.382h2.122a5.381,5.381,0,1,1,0,10.761H35.147V22.51c-4.891,5.031-9.083,9.28-9.083,9.28Z" transform="translate(726.809 747.881)"/>
<path id="Rectangle_23" data-name="Rectangle 23" class="cls-3" d="M4,0h6.763a0,0,0,0,1,0,0V8a0,0,0,0,1,0,0H4A4,4,0,0,1,0,4V4A4,4,0,0,1,4,0Z" transform="translate(728.092 759.729)"/>
<path id="Rectangle_24" data-name="Rectangle 24" class="cls-3" d="M4,0h6.763a0,0,0,0,1,0,0V8a0,0,0,0,1,0,0H4A4,4,0,0,1,0,4V4A4,4,0,0,1,4,0Z" transform="translate(768.077 767.725) rotate(180)"/>
<path id="Path_42" data-name="Path 42" class="cls-4" d="M.3,0H8.1a.3.3,0,0,1,.3.3V7.7a.3.3,0,0,1-.3.3H.3A.3.3,0,0,1,0,7.7V.3A.3.3,0,0,1,.3,0Z" transform="translate(743.889 759.729)"/>
<path id="Path_15" data-name="Path 15" class="cls-3" d="M-102.228-1598.9l8.293-.1,6.22,6.417-2.567,2.567v4.64h-2.369v-2.666a1.99,1.99,0,0,0-1.975-1.974c-1.927-.031-7.207,0-7.207,0a1.606,1.606,0,0,0-1.678,1.678v2.962h-2.369v-4.64l-2.567-2.567Z" transform="translate(846.216 2348.264)"/>
<path id="Path_16" data-name="Path 16" class="cls-3" d="M6.264.062,14.505,0l6.236,6.412L18.135,8.954v4.667H15.79V10.945a2,2,0,0,0-1.969-1.99c-1.927-.031-7.166,0-7.166,0A1.689,1.689,0,0,0,4.93,10.679v2.942H2.543V8.954L0,6.412Z" transform="translate(758.509 778.175) rotate(180)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,65 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1327.274 8333.921 23.497 21.72">
<defs>
<style>
.cls-1 {
fill: #a8a9a8;
}
.cls-2 {
clip-path: url(#clip-path);
}
.cls-3 {
fill: url(#linear-gradient);
}
.cls-4 {
fill: #b72b1c;
}
.cls-5 {
fill: #f2f2f2;
}
.cls-6 {
filter: url(#Path_1);
}
</style>
<clipPath id="clip-path">
<path id="Union_5" data-name="Union 5" class="cls-1" d="M2.543,21.72c-.7,0-1.26-.4-1.26-.9V17.968H.494A.494.494,0,0,1,0,17.475V4.64a.494.494,0,0,1,.494-.494h.79V.9c0-.5.564-.9,1.26-.9H20.954c.7,0,1.26.4,1.26.9v3.25H23a.494.494,0,0,1,.494.494V17.475a.494.494,0,0,1-.494.494h-.79v2.855c0,.5-.564.9-1.26.9Z"/>
</clipPath>
<linearGradient id="linear-gradient" x1="0.5" y1="0.901" x2="0.5" y2="1.068" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#a8a9a8"/>
<stop offset="1" stop-color="#545554"/>
</linearGradient>
<filter id="Path_1" x="1319.557" y="8327.921" width="38.93" height="39.72" filterUnits="userSpaceOnUse">
<feOffset dy="3" input="SourceAlpha"/>
<feGaussianBlur stdDeviation="3" result="blur"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<g id="icn_block_color_sensor" transform="translate(666.315 8209.204)">
<g id="Mask_Group_5" data-name="Mask Group 5" class="cls-2" transform="translate(660.959 124.718)">
<g id="Group_4" data-name="Group 4" transform="translate(0)">
<g id="Group_2" data-name="Group 2">
<path id="Path_28" data-name="Path 28" class="cls-1" d="M.494,0H23A.494.494,0,0,1,23.5.494V13.328a.494.494,0,0,1-.494.494H.494A.494.494,0,0,1,0,13.328V.494A.494.494,0,0,1,.494,0Z" transform="translate(0 4.147)"/>
<g class="cls-6" transform="matrix(1, 0, 0, 1, -1327.27, -8333.92)">
<path id="Path_1-2" data-name="Path 1" class="cls-3" d="M1.26,0H19.67c.7,0,1.26.4,1.26.9V20.823c0,.5-.564.9-1.26.9H1.26c-.7,0-1.26-.4-1.26-.9V.9C0,.4.564,0,1.26,0Z" transform="translate(1328.56 8333.92)"/>
</g>
<rect id="Rectangle_2" data-name="Rectangle 2" width="0.494" height="3.949" transform="translate(22.51 6.121)"/>
<rect id="Rectangle_5" data-name="Rectangle 5" width="0.494" height="3.949" transform="translate(0.592 6.121)"/>
<rect id="Rectangle_3" data-name="Rectangle 3" width="0.494" height="3.949" transform="translate(22.51 11.748)"/>
<rect id="Rectangle_4" data-name="Rectangle 4" width="0.494" height="3.949" transform="translate(0.592 11.748)"/>
</g>
<path id="Union_1" data-name="Union 1" class="cls-4" d="M1.678,11.551a4.557,4.557,0,0,1,.1-.973,6.22,6.22,0,1,1,8.874,0,4.542,4.542,0,1,1-8.979.973Z" transform="translate(5.529 2.666)"/>
<path id="Union_2" data-name="Union 2" d="M1.738,10.614A3.5,3.5,0,0,1,1.98,9.332,5.233,5.233,0,1,1,8.5,9.317a3.507,3.507,0,1,1-6.765,1.3Z" transform="translate(6.516 3.602)"/>
<g id="Group_3" data-name="Group 3" transform="translate(9.379 6.615)">
<ellipse id="Ellipse_5" data-name="Ellipse 5" class="cls-5" cx="2.369" cy="2.369" rx="2.369" ry="2.369"/>
<ellipse id="Ellipse_6" data-name="Ellipse 6" class="cls-5" cx="1.283" cy="1.283" rx="1.283" ry="1.283" transform="translate(1.086 6.22)"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,26 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1299.627 9145.076 41.445 32.779">
<defs>
<style>
.cls-1 {
fill: url(#linear-gradient);
}
.cls-2 {
fill: #3c3c3c;
}
.cls-3 {
fill: #a0b5a6;
}
</style>
<linearGradient id="linear-gradient" x1="0.5" y1="0.924" x2="0.5" y2="0.948" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#a8a9a8"/>
<stop offset="1" stop-color="gray"/>
</linearGradient>
</defs>
<g id="icn_block_display" transform="translate(666.315 8209.204)">
<path id="Path_91" data-name="Path 91" class="cls-1" d="M.816,0H40.629a.816.816,0,0,1,.816.816V31.963a.816.816,0,0,1-.816.816H.816A.816.816,0,0,1,0,31.963V.816A.816.816,0,0,1,.816,0Z" transform="translate(633.313 935.874)"/>
<path id="Path_92" data-name="Path 92" class="cls-2" d="M1.57,0H32.4a1.57,1.57,0,0,1,1.57,1.57V18.9a1.57,1.57,0,0,1-1.57,1.57H1.57A1.57,1.57,0,0,1,0,18.9V1.57A1.57,1.57,0,0,1,1.57,0Z" transform="translate(637.08 940.207)"/>
<path id="Path_93" data-name="Path 93" class="cls-3" d="M1.13,0H27.316a1.13,1.13,0,0,1,1.13,1.13v16.7a1.13,1.13,0,0,1-1.13,1.13H1.13A1.13,1.13,0,0,1,0,17.834V1.13A1.13,1.13,0,0,1,1.13,0Z" transform="translate(639.906 941.023)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,101 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1306.936 8729.215 61.393 44.083">
<defs>
<style>
.cls-1 {
fill: #d5277e;
}
.cls-2 {
fill: #a8a9a8;
}
.cls-3 {
clip-path: url(#clip-path);
}
.cls-4 {
clip-path: url(#clip-path-2);
}
.cls-11, .cls-5 {
fill: #9a9a9a;
}
.cls-6 {
fill: #f2f2f2;
}
.cls-7 {
opacity: 0.6;
fill: url(#linear-gradient);
}
.cls-8 {
fill: url(#linear-gradient-2);
}
.cls-9 {
fill: #b72b1c;
}
.cls-10, .cls-11 {
stroke: none;
}
.cls-12 {
filter: url(#Path_12);
}
</style>
<clipPath id="clip-path">
<path id="Path_88" data-name="Path 88" class="cls-1" d="M1162.538,3051.215l1.79,38.862h-31.593l-5.221,5.221h-11.692l-5.221-5.221h-7.666l1.729-38.862Z" transform="translate(-1124.637 -3056.569)"/>
</clipPath>
<clipPath id="clip-path-2">
<path id="Union_7" data-name="Union 7" class="cls-2" d="M6.318,39.688a6.076,6.076,0,0,1-1.291-.3H2.271A1.283,1.283,0,0,1,.987,38.108V35.147H.494A.494.494,0,0,1,0,34.653V4.542a.494.494,0,0,1,.494-.494H.987V1.284A1.283,1.283,0,0,1,2.271,0h8.237V.395h2.226V0h8.3a1.284,1.284,0,0,1,1.284,1.284V4.048H22.9a.494.494,0,0,1,.494.494V34.653a.494.494,0,0,1-.494.493h-.592v2.962a1.284,1.284,0,0,1-1.284,1.283h-2.7c-.111.2-1.244.3-1.451.3Z"/>
</clipPath>
<filter id="Path_12" x="1328.499" y="8733.444" width="23.575" height="33.349" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.375" result="blur"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur"/>
<feComposite in="SourceGraphic"/>
</filter>
<linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#fff" stop-opacity="0"/>
<stop offset="1" stop-color="#404040"/>
</linearGradient>
<linearGradient id="linear-gradient-2" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#fff"/>
<stop offset="1" stop-color="gray"/>
</linearGradient>
</defs>
<g id="icn_block_gyro" transform="translate(666.315 8209.204)">
<g id="Mask_Group_11" data-name="Mask Group 11" class="cls-3" transform="translate(662.322 525.366)">
<g id="Group_16" data-name="Group 16">
<g id="Mask_Group_7" data-name="Mask Group 7" class="cls-4" transform="translate(0 0)">
<g id="Group_9" data-name="Group 9" transform="translate(0 0)">
<path id="Path_29" data-name="Path 29" class="cls-2" d="M.494,0H22.9A.494.494,0,0,1,23.4.494V30.605a.494.494,0,0,1-.494.494H.494A.494.494,0,0,1,0,30.605V.494A.494.494,0,0,1,.494,0Z" transform="translate(0 4.048)"/>
<rect id="Rectangle_11" data-name="Rectangle 11" class="cls-5" width="3.752" height="10.268" transform="translate(9.774 0.395)"/>
<g class="cls-12" transform="matrix(1, 0, 0, 1, -1328.64, -8734.57)">
<path id="Path_12-2" data-name="Path 12" class="cls-2" d="M1.283,0H9.52V10.424l2.226-.163V0h8.3a1.283,1.283,0,0,1,1.283,1.283V29.815A1.283,1.283,0,0,1,20.041,31.1H1.283A1.283,1.283,0,0,1,0,29.815V1.283A1.283,1.283,0,0,1,1.283,0Z" transform="translate(1329.62 8734.57)"/>
</g>
<g id="hvid" transform="translate(0.987 19.252)">
<g id="hvid-2" data-name="hvid" transform="translate(0)">
<path id="Path_57" data-name="Path 57" class="cls-6" d="M.79,0H20.535a.79.79,0,0,1,.79.79V18.857a1.283,1.283,0,0,1-1.283,1.283H1.283A1.283,1.283,0,0,1,0,18.857V.79A.79.79,0,0,1,.79,0Z" transform="translate(0)"/>
<path id="Path_59" data-name="Path 59" class="cls-7" d="M0,0H21.325V1.975a1.283,1.283,0,0,1-1.283,1.283H1.283A1.283,1.283,0,0,1,0,1.975Z" transform="translate(0 16.882)"/>
</g>
<g id="Path_1" data-name="Path 1" class="cls-8" transform="translate(15.935 18.955)">
<path class="cls-10" d="M -0.03972615301609039 1.355897426605225 L -10.6034460067749 1.355897426605225 C -10.8238697052002 1.355897426605225 -11.76168155670166 1.143560767173767 -12.02564239501953 0.9932262897491455 L -11.25642585754395 0.3544974625110626 C -11.06739616394043 0.1967574656009674 -10.78548622131348 0.1249974593520164 -10.6034460067749 0.1249974593520164 L -0.03972615301609039 0.1249974593520164 C 0.08689384907484055 0.1249974593520164 0.1953838467597961 0.221777468919754 0.3209938406944275 0.3338374495506287 C 0.3559758961200714 0.3650458753108978 0.3912657201290131 0.3964739441871643 0.4275123476982117 0.4264010488986969 L 1.240363001823425 1.159494996070862 C 0.997438907623291 1.265054941177368 0.2347392439842224 1.355897426605225 -0.03972615301609039 1.355897426605225 Z"/>
<path class="cls-11" d="M -0.03972615301609039 1.230897426605225 C 0.1518102586269379 1.230897426605225 0.6746260523796082 1.174463033676147 0.9910745024681091 1.102993011474609 L 0.3458296954631805 0.5210594534873962 C 0.3090922832489014 0.490643322467804 0.2732802927494049 0.4587787985801697 0.2377838492393494 0.4271174669265747 C 0.1312438398599625 0.3320774734020233 0.03924384713172913 0.249997466802597 -0.03972615301609039 0.249997466802597 L -10.6034460067749 0.249997466802597 C -10.76875591278076 0.249997466802597 -11.01853656768799 0.3187874555587769 -11.1765661239624 0.4506674706935883 L -11.78844928741455 0.9587525725364685 C -11.43126487731934 1.086030006408691 -10.7613353729248 1.230897426605225 -10.6034460067749 1.230897426605225 L -0.03972615301609039 1.230897426605225 M -0.03972615301609039 1.480897426605225 L -10.6034460067749 1.480897426605225 C -10.82154655456543 1.480897426605225 -12.20312595367432 1.196227431297302 -12.20312595367432 0.9781274795532227 L -11.33627605438232 0.258327454328537 C -11.12889575958252 0.08526746183633804 -10.82154655456543 -2.538394937801058e-06 -10.6034460067749 -2.538394937801058e-06 L -0.03972615301609039 -2.538394937801058e-06 C 0.1783738434314728 -2.538394937801058e-06 0.3312638401985168 0.1853174567222595 0.5091438293457031 0.3316974639892578 L 1.42017388343811 1.153337478637695 C 1.42017388343811 1.371437430381775 0.1783738434314728 1.480897426605225 -0.03972615301609039 1.480897426605225 Z"/>
</g>
</g>
<g id="red_things" data-name="red things" transform="translate(2.962 5.529)">
<ellipse id="red_dot" data-name="red dot" class="cls-9" cx="1.975" cy="1.975" rx="1.975" ry="1.975" transform="translate(6.713 3.85)"/>
<path id="red_arrow_1" data-name="red arrow 1" class="cls-9" d="M3121.088-1937.325a6.718,6.718,0,0,1-.494-7.01c.151.093.443.226.592.3.42.239.482-.2.4-.494l-.79-2.468-2.468.691a.939.939,0,0,0-.3.1c-.129.082-.24.258,0,.395l.691.395a8.146,8.146,0,0,0,.691,9.28C3120.449-1936.882,3121.088-1937.325,3121.088-1937.325Z" transform="translate(-3117.592 1947)"/>
<path id="red_arrow_2" data-name="red arrow 2" class="cls-9" d="M3118.12-1937.325a6.718,6.718,0,0,0,.493-7.01c-.151.093-.443.226-.592.3-.42.239-.482-.2-.395-.494l.79-2.468,2.468.691a.943.943,0,0,1,.3.1c.128.082.24.258,0,.395l-.691.395a8.147,8.147,0,0,1-.691,9.28C3118.758-1936.882,3118.12-1937.325,3118.12-1937.325Z" transform="translate(-3104.259 1947)"/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,65 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1323.372 8463.761 30.979 30.979">
<defs>
<style>
.cls-1 {
fill: url(#linear-gradient);
}
.cls-2 {
fill: #a8a9a8;
}
.cls-3 {
fill: #3c3c3c;
}
.cls-4 {
fill: #b72b1c;
stroke: #8b1104;
stroke-width: 0.25px;
}
.cls-5 {
stroke: none;
}
.cls-6 {
fill: none;
}
.cls-7 {
filter: url(#Union_1);
}
</style>
<linearGradient id="linear-gradient" x1="0.5" y1="0.919" x2="0.5" y2="1.077" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#a8a9a8"/>
<stop offset="1" stop-color="#545554"/>
</linearGradient>
<filter id="Union_1" x="1323.372" y="8463.761" width="30.979" height="30.979" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="0.375" result="blur"/>
<feFlood flood-opacity="0.322"/>
<feComposite operator="in" in2="blur"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<g id="icn_block_medium_motor" transform="translate(666.315 8209.204)">
<g id="Group_4" data-name="Group 4" transform="translate(658.182 255.683)">
<path id="Path_1" data-name="Path 1" class="cls-1" d="M2.383-.287H27.768A1.534,1.534,0,0,1,29.44,1V27.258c0,.654-.714,1.185-1.673,1.185H2.383c-.959,0-1.673-.531-1.673-1.185V1A1.534,1.534,0,0,1,2.383-.287Z" transform="translate(-0.711 0.287)"/>
</g>
<g id="Group_7" data-name="Group 7" transform="translate(686.912 255.683) rotate(90)">
<g class="cls-7" transform="matrix(0, -1, 1, 0, -8464.89, 1353.23)">
<path id="Union_1-2" data-name="Union 1" class="cls-2" d="M13.822,28.729a4.048,4.048,0,0,1-4.048-4.048V18.955H4.048A4.048,4.048,0,0,1,0,14.908V13.822A4.048,4.048,0,0,1,4.048,9.774H9.774V4.048A4.048,4.048,0,0,1,13.822,0h1.086a4.048,4.048,0,0,1,4.048,4.048V9.774h5.726a4.048,4.048,0,0,1,4.048,4.048v1.086a4.048,4.048,0,0,1-4.048,4.048H18.955v5.726a4.048,4.048,0,0,1-4.048,4.048Z" transform="translate(1353.23 8464.89) rotate(90)"/>
</g>
<ellipse id="Ellipse_1" data-name="Ellipse 1" class="cls-3" cx="3.159" cy="3.159" rx="3.159" ry="3.159" transform="translate(11.255 0.987)"/>
<ellipse id="Ellipse_2" data-name="Ellipse 2" class="cls-3" cx="3.159" cy="3.159" rx="3.159" ry="3.159" transform="translate(11.255 21.424)"/>
<ellipse id="Ellipse_1-2" data-name="Ellipse 1" class="cls-3" cx="3.159" cy="3.159" rx="3.159" ry="3.159" transform="translate(0.987 17.475) rotate(-90)"/>
<ellipse id="Ellipse_2-2" data-name="Ellipse 2" class="cls-3" cx="3.159" cy="3.159" rx="3.159" ry="3.159" transform="translate(21.424 17.475) rotate(-90)"/>
</g>
<g id="Ellipse_4" data-name="Ellipse 4" class="cls-4" transform="translate(668.3 265.702)">
<ellipse class="cls-5" cx="4.395" cy="4.395" rx="4.395" ry="4.395"/>
<ellipse class="cls-6" cx="4.395" cy="4.395" rx="4.27" ry="4.27"/>
</g>
<path id="Hole" d="M5605.5,961.821s-.035.664-.5.67-.952,0-.952,0a1.541,1.541,0,0,0-.3,1.1c0,.824.232,1.045.232,1.045h1.06a.42.42,0,0,1,.454.454v1.085a2.528,2.528,0,0,0,1.149.187,4.2,4.2,0,0,0,1.091-.187v-1.085a.475.475,0,0,1,.478-.454,6.978,6.978,0,0,0,.94-.091s.257-.243.282-1.062-.23-1.07-.23-1.07h-1.1a.417.417,0,0,1-.5-.441,7.426,7.426,0,0,1,0-1.07,3.135,3.135,0,0,0-2.113,0C5605.488,961.354,5605.5,961.821,5605.5,961.821Z" transform="translate(-4933.915 -693.478)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,84 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1327.51 8602.067 23.497 21.72">
<defs>
<style>
.cls-1 {
fill: #a8a9a8;
}
.cls-2 {
clip-path: url(#clip-path);
}
.cls-3 {
fill: url(#linear-gradient);
}
.cls-4 {
fill: url(#linear-gradient-2);
}
.cls-5 {
fill: #b72b1c;
stroke: #8b1104;
stroke-width: 0.25px;
}
.cls-6 {
stroke: none;
}
.cls-7 {
fill: none;
}
.cls-8 {
filter: url(#Path_1);
}
</style>
<clipPath id="clip-path">
<path id="Union_3" data-name="Union 3" class="cls-1" d="M2.567,21.72c-.7,0-1.283-.393-1.283-.889V17.968H.651A.651.651,0,0,1,0,17.317V4.8a.651.651,0,0,1,.651-.651h.633V.889C1.283.394,1.871,0,2.567,0H9.576V.889h4.147V0H20.93c.7,0,1.283.394,1.283.889V4.147h.633A.65.65,0,0,1,23.5,4.8v12.52a.651.651,0,0,1-.651.651h-.633v2.863c0,.5-.588.889-1.283.889Z"/>
</clipPath>
<linearGradient id="linear-gradient" x1="0.5" y1="0.91" x2="0.5" y2="1.046" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#a8a9a8"/>
<stop offset="1" stop-color="#545554"/>
</linearGradient>
<filter id="Path_1" x="1325.794" y="8599.067" width="26.93" height="27.72" filterUnits="userSpaceOnUse">
<feOffset input="SourceAlpha"/>
<feGaussianBlur stdDeviation="1" result="blur"/>
<feFlood flood-opacity="0.502"/>
<feComposite operator="in" in2="blur"/>
<feComposite in="SourceGraphic"/>
</filter>
<linearGradient id="linear-gradient-2" x1="0.949" y1="0.5" x2="0.056" y2="0.5" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#b72b1c"/>
<stop offset="1" stop-color="#8b1104"/>
</linearGradient>
</defs>
<g id="icn_block_touch_sensor" transform="translate(666.315 8209.204)">
<g id="Group_8" data-name="Group 8" transform="translate(661.196 392.864)">
<g id="Mask_Group_3" data-name="Mask Group 3" class="cls-2">
<g id="Group_2" data-name="Group 2" transform="translate(0 0)">
<path id="Path_27" data-name="Path 27" class="cls-1" d="M.494,0H23A.494.494,0,0,1,23.5.494V13.328a.494.494,0,0,1-.494.494H.494A.494.494,0,0,1,0,13.328V.494A.494.494,0,0,1,.494,0Z" transform="translate(0 4.147)"/>
<g class="cls-8" transform="matrix(1, 0, 0, 1, -1327.51, -8602.07)">
<path id="Path_1-2" data-name="Path 1" class="cls-3" d="M1.283,0h7.01V.889H12.44V0h7.207c.7,0,1.283.393,1.283.889V20.831c0,.5-.588.889-1.283.889H1.283c-.7,0-1.283-.393-1.283-.889V.889C0,.393.588,0,1.283,0Z" transform="translate(1328.79 8602.07)"/>
</g>
<rect id="Rectangle_2" data-name="Rectangle 2" width="0.494" height="3.949" transform="translate(22.51 6.121)"/>
<rect id="Rectangle_5" data-name="Rectangle 5" width="0.494" height="3.949" transform="translate(0.592 6.121)"/>
<rect id="Rectangle_3" data-name="Rectangle 3" width="0.494" height="3.949" transform="translate(22.51 11.748)"/>
<rect id="Rectangle_4" data-name="Rectangle 4" width="0.494" height="3.949" transform="translate(0.592 11.748)"/>
</g>
</g>
</g>
<g id="Group_5" data-name="Group 5" transform="translate(664.158 395.579)">
<rect id="Rectangle_6" data-name="Rectangle 6" class="cls-4" width="6.22" height="4.048" transform="translate(0 6.861)"/>
<rect id="Rectangle_9" data-name="Rectangle 9" class="cls-4" width="6.22" height="4.048" transform="translate(10.811) rotate(90)"/>
<rect id="Rectangle_7" data-name="Rectangle 7" class="cls-4" width="6.22" height="4.048" transform="translate(17.573 10.909) rotate(180)"/>
<rect id="Rectangle_8" data-name="Rectangle 8" class="cls-4" width="6.22" height="4.048" transform="translate(6.763 17.573) rotate(-90)"/>
<g id="Ellipse_1" data-name="Ellipse 1" class="cls-5" transform="translate(4.838 4.887)">
<ellipse class="cls-6" cx="3.949" cy="3.949" rx="3.949" ry="3.949"/>
<ellipse class="cls-7" cx="3.949" cy="3.949" rx="3.824" ry="3.824"/>
</g>
<path id="Hole" d="M5605.323,961.71s-.032.6-.45.6-.854,0-.854,0a1.382,1.382,0,0,0-.266.989c0,.74.208.939.208.939h.953a.378.378,0,0,1,.409.408v.975a2.269,2.269,0,0,0,1.033.168,3.77,3.77,0,0,0,.98-.168v-.975a.426.426,0,0,1,.43-.408,6.239,6.239,0,0,0,.845-.082s.231-.219.253-.955-.207-.961-.207-.961h-.99a.375.375,0,0,1-.446-.4,6.76,6.76,0,0,1,0-.961,2.814,2.814,0,0,0-1.9,0C5605.313,961.289,5605.323,961.71,5605.323,961.71Z" transform="translate(-5597.534 -954.45)"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,103 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1324.724 8870.247 54.201 22.707">
<defs>
<style>
.cls-1 {
fill: #f2f2f2;
}
.cls-2 {
fill: #292929;
}
.cls-3 {
stroke: rgba(242,242,242,0.5);
stroke-width: 0.15px;
}
.cls-4 {
fill: #931f1f;
}
.cls-5 {
fill: #9d761f;
}
.cls-6 {
clip-path: url(#clip-path);
}
.cls-7 {
stroke: none;
}
.cls-8 {
fill: none;
}
</style>
<clipPath id="clip-path">
<ellipse id="guld" class="cls-1" cx="4.541" cy="4.541" rx="4.541" ry="4.541"/>
</clipPath>
</defs>
<g id="icn_block_ultra_sonic" transform="translate(666.315 8209.204)">
<rect id="Rectangle_1" data-name="Rectangle 1" class="cls-2" width="28.236" height="20.338" transform="translate(673.021 661.932)"/>
<rect id="Rectangle_2" data-name="Rectangle 2" width="16.487" height="11.452" transform="translate(677.958 666.474)"/>
<g id="eye1" transform="translate(658.41 661.044)">
<g id="sort" class="cls-3" transform="translate(0 0)">
<ellipse class="cls-7" cx="11.354" cy="11.354" rx="11.354" ry="11.354"/>
<ellipse class="cls-8" cx="11.354" cy="11.354" rx="11.279" ry="11.279"/>
</g>
<ellipse id="rød" class="cls-4" cx="7.01" cy="7.01" rx="7.01" ry="7.01" transform="translate(4.344 4.344)"/>
<ellipse id="guld-3" data-name="guld" class="cls-5" cx="5.232" cy="5.232" rx="5.232" ry="5.232" transform="translate(6.121 6.121)"/>
<ellipse id="guld-4" data-name="guld" class="cls-1" cx="4.541" cy="4.541" rx="4.541" ry="4.541" transform="translate(6.812 6.812)"/>
<g id="Group_5" data-name="Group 5" transform="translate(6.812 6.812)">
<g id="Mask_Group_8" data-name="Mask Group 8" class="cls-6">
<g id="Group_17" data-name="Group 17" transform="translate(-4.652 2.089) rotate(-30)">
<rect id="Rectangle_84" data-name="Rectangle 84" class="cls-5" width="0.395" height="14.834" transform="translate(1.333 0)"/>
<rect id="Rectangle_91" data-name="Rectangle 91" class="cls-5" width="0.395" height="14.649" transform="translate(0 13.081) rotate(-90)"/>
<rect id="Rectangle_85" data-name="Rectangle 85" class="cls-5" width="0.395" height="14.834" transform="translate(3.209 0)"/>
<rect id="Rectangle_97" data-name="Rectangle 97" class="cls-5" width="0.395" height="14.649" transform="translate(0 11.205) rotate(-90)"/>
<rect id="Rectangle_86" data-name="Rectangle 86" class="cls-5" width="0.395" height="14.834" transform="translate(5.084 0)"/>
<rect id="Rectangle_96" data-name="Rectangle 96" class="cls-5" width="0.395" height="14.649" transform="translate(0 9.33) rotate(-90)"/>
<rect id="Rectangle_87" data-name="Rectangle 87" class="cls-5" width="0.395" height="14.834" transform="translate(6.96 0)"/>
<rect id="Rectangle_95" data-name="Rectangle 95" class="cls-5" width="0.395" height="14.649" transform="translate(0 7.454) rotate(-90)"/>
<rect id="Rectangle_88" data-name="Rectangle 88" class="cls-5" width="0.395" height="14.834" transform="translate(8.836 0)"/>
<rect id="Rectangle_94" data-name="Rectangle 94" class="cls-5" width="0.395" height="14.649" transform="translate(0 5.578) rotate(-90)"/>
<rect id="Rectangle_89" data-name="Rectangle 89" class="cls-5" width="0.395" height="14.834" transform="translate(10.712 0)"/>
<rect id="Rectangle_93" data-name="Rectangle 93" class="cls-5" width="0.395" height="14.649" transform="translate(0 3.702) rotate(-90)"/>
<rect id="Rectangle_90" data-name="Rectangle 90" class="cls-5" width="0.395" height="14.834" transform="translate(12.588 0)"/>
<rect id="Rectangle_92" data-name="Rectangle 92" class="cls-5" width="0.395" height="14.649" transform="translate(0 1.826) rotate(-90)"/>
</g>
</g>
</g>
</g>
<g id="eye2" transform="translate(689.903 661.044)">
<g id="sort-2" data-name="sort" class="cls-3" transform="translate(0 0)">
<ellipse class="cls-7" cx="11.354" cy="11.354" rx="11.354" ry="11.354"/>
<ellipse class="cls-8" cx="11.354" cy="11.354" rx="11.279" ry="11.279"/>
</g>
<ellipse id="rød-2" data-name="rød" class="cls-4" cx="7.01" cy="7.01" rx="7.01" ry="7.01" transform="translate(4.344 4.344)"/>
<ellipse id="guld-5" data-name="guld" class="cls-5" cx="5.232" cy="5.232" rx="5.232" ry="5.232" transform="translate(6.121 6.121)"/>
<ellipse id="guld-6" data-name="guld" class="cls-1" cx="4.541" cy="4.541" rx="4.541" ry="4.541" transform="translate(6.812 6.812)"/>
<g id="Group_18" data-name="Group 18" transform="translate(6.812 6.812)">
<g id="Mask_Group_8-2" data-name="Mask Group 8" class="cls-6">
<g id="Group_17-2" data-name="Group 17" transform="translate(-4.652 2.089) rotate(-30)">
<rect id="Rectangle_84-2" data-name="Rectangle 84" class="cls-5" width="0.395" height="14.834" transform="translate(1.333 0)"/>
<rect id="Rectangle_91-2" data-name="Rectangle 91" class="cls-5" width="0.395" height="14.649" transform="translate(0 13.081) rotate(-90)"/>
<rect id="Rectangle_85-2" data-name="Rectangle 85" class="cls-5" width="0.395" height="14.834" transform="translate(3.209 0)"/>
<rect id="Rectangle_97-2" data-name="Rectangle 97" class="cls-5" width="0.395" height="14.649" transform="translate(0 11.205) rotate(-90)"/>
<rect id="Rectangle_86-2" data-name="Rectangle 86" class="cls-5" width="0.395" height="14.834" transform="translate(5.084 0)"/>
<rect id="Rectangle_96-2" data-name="Rectangle 96" class="cls-5" width="0.395" height="14.649" transform="translate(0 9.33) rotate(-90)"/>
<rect id="Rectangle_87-2" data-name="Rectangle 87" class="cls-5" width="0.395" height="14.834" transform="translate(6.96 0)"/>
<rect id="Rectangle_95-2" data-name="Rectangle 95" class="cls-5" width="0.395" height="14.649" transform="translate(0 7.454) rotate(-90)"/>
<rect id="Rectangle_88-2" data-name="Rectangle 88" class="cls-5" width="0.395" height="14.834" transform="translate(8.836 0)"/>
<rect id="Rectangle_94-2" data-name="Rectangle 94" class="cls-5" width="0.395" height="14.649" transform="translate(0 5.578) rotate(-90)"/>
<rect id="Rectangle_89-2" data-name="Rectangle 89" class="cls-5" width="0.395" height="14.834" transform="translate(10.712 0)"/>
<rect id="Rectangle_93-2" data-name="Rectangle 93" class="cls-5" width="0.395" height="14.649" transform="translate(0 3.702) rotate(-90)"/>
<rect id="Rectangle_90-2" data-name="Rectangle 90" class="cls-5" width="0.395" height="14.834" transform="translate(12.588 0)"/>
<rect id="Rectangle_92-2" data-name="Rectangle 92" class="cls-5" width="0.395" height="14.649" transform="translate(0 1.826) rotate(-90)"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,73 @@
# Functions for measuring in Swift Playgrounds "EV3 Animal Rescue" (Miranda)
## Sensors
* Ultrasonic (cm, inches)
* Gyro (angle, rate)
* Reset Gyro
* Touch (count, on/off)
* Light (color, reflection, ambience)
* IR (proximity, seek)
## Motor Sensors
* Motor (degrees, rotations, power)
#### Wait for
All sensor methods have a `waitFor` version that waits for the sensor value to be >= or <=. We don't use '=' equality because it is non-sensical for floating point data.
All sensors also have a `waitForIncrease`, `waitForDecrease` version.
------------------------
# Output Functions
* Move tank ( for seconds, for degrees, for rotations, indefinitely )
* Stop Move (stops 2 motors)
* Motor off
* Motor on (for seconds, for degrees, for rotations, indefinitely)
* Reset motor (resets all counters related to the motor)
# Brick Functions
* Brick light on (color + mode: flashing, on, or pulsating)
* Brick light off
* Play sound (wait for completion, play once, play repeating)
- Parameters:
- file: Takes an input conforming to enum `SoundFile`. One of the following:
- `.hello`
- `.goodbye`
- `.fanfare`
- `.errorAlarm`
- `.start`
- `.stop`
- `.object`
- `.ouch`
- `.blip`
- `.arm`
- `.snap`
- `.laser`
* Play sound frequency (for seconds, can either wait for completion or continue while playing)
* Play sound note (in range `C4-D#9`) (for seconds, can either wait for completion or continue while playing)
* Stopsound (stops all sounds playing)
* Wait for seconds
* Display text
* Display text at `(x,y)` with color`(black, white)`, font`(bold, normal, large)` with option to clear screen
* Display line from `(x1,y1)` to `(x2,y2)` with color `(black, white)` option to clear screen
* Display rectangle at `(x,y)` with `(width, height)`, with fill or no fill, with color `(black, white)`, option to clear screen
* Display image at `(x,y)`, option to clear screen.
takes an input conforming to enum `ImageName`. One of the following:
- `.neutral`
- `.pinchRight`
- `.awake`
- `.hurt`
- `.accept`
- `.decline`
- `.questionMark`
- `.warning`
- `.stop`
- `.pirate`
- `.boom`
- `.ev3Icon`

1370
legoresources/RobotAPI.swift Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,246 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="1925.358 6183.438 36.101 36.101003"
version="1.1"
id="svg41"
sodipodi:docname="Color Sensor.svg"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\colorSensor-icon.png"
inkscape:export-xdpi="319.10471"
inkscape:export-ydpi="319.10471"
width="36.101002"
height="36.101002"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata45">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1137"
id="namedview43"
showgrid="false"
inkscape:zoom="7.072009"
inkscape:cx="18.050501"
inkscape:cy="16.685499"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg41" />
<defs
id="defs22">
<style
id="style2">
.cls-1 {
fill: #a8a9a8;
}
.cls-2 {
clip-path: url(#clip-path);
}
.cls-3 {
fill: url(#linear-gradient);
}
.cls-4 {
fill: #b72b1c;
}
.cls-5 {
fill: #f2f2f2;
}
.cls-6 {
filter: url(#Path_1);
}
</style>
<clipPath
id="clip-path">
<path
id="Union_5"
data-name="Union 5"
class="cls-1"
d="m 3.907,33.37 c -1.069,0 -1.935,-0.617 -1.935,-1.377 V 27.606 H 0.758 A 0.758,0.758 0 0 1 0,26.848 V 7.129 A 0.758,0.758 0 0 1 0.758,6.371 H 1.972 V 1.377 C 1.972,0.617 2.838,0 3.907,0 h 28.287 c 1.069,0 1.935,0.617 1.935,1.377 v 4.994 h 1.213 a 0.758,0.758 0 0 1 0.759,0.758 v 19.719 a 0.758,0.758 0 0 1 -0.759,0.758 h -1.213 v 4.387 c 0,0.761 -0.867,1.377 -1.935,1.377 z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</clipPath>
<linearGradient
id="linear-gradient"
x1="16.378942"
y1="29.514856"
x2="16.378942"
y2="34.98542"
gradientUnits="userSpaceOnUse"
gradientTransform="scale(0.98165674,1.018686)">
<stop
offset="0"
stop-color="#a8a9a8"
id="stop6" />
<stop
offset="1"
stop-color="#545554"
id="stop8" />
</linearGradient>
<filter
id="Path_1"
x="1918.33"
y="6177.438"
width="50.157001"
height="51.370998"
filterUnits="userSpaceOnUse">
<feOffset
dy="3"
input="SourceAlpha"
id="feOffset11" />
<feGaussianBlur
stdDeviation="3"
result="blur"
id="feGaussianBlur13" />
<feFlood
flood-opacity="0.502"
id="feFlood15" />
<feComposite
operator="in"
in2="blur"
id="feComposite17"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite19" />
</filter>
</defs>
<g
id="Color_Sensor"
data-name="Color Sensor"
transform="translate(1346,5555.3645)">
<g
id="Mask_Group_5"
data-name="Mask Group 5"
class="cls-2"
transform="translate(579.358,629.439)"
clip-path="url(#clip-path)">
<g
id="Group_4"
data-name="Group 4">
<g
id="Group_2"
data-name="Group 2">
<path
id="Path_28"
data-name="Path 28"
class="cls-1"
d="M 0.758,0 H 35.342 A 0.758,0.758 0 0 1 36.1,0.758 v 19.719 a 0.758,0.758 0 0 1 -0.758,0.758 H 0.758 A 0.758,0.758 0 0 1 0,20.477 V 0.758 A 0.758,0.758 0 0 1 0.758,0 Z"
transform="translate(0,6.371)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
<g
class="cls-6"
transform="translate(-1925.36,-6183.44)"
id="g26"
style="filter:url(#Path_1)">
<path
id="Path_1-2"
data-name="Path 1"
class="cls-3"
d="m 1.935,0 h 28.287 c 1.069,0 1.935,0.617 1.935,1.377 v 30.616 c 0,0.761 -0.866,1.377 -1.935,1.377 H 1.935 C 0.866,33.371 0,32.754 0,31.993 V 1.377 C 0,0.617 0.866,0 1.935,0 Z"
transform="translate(1927.33,6183.44)"
inkscape:connector-curvature="0"
style="fill:url(#linear-gradient)" />
</g>
<rect
id="Rectangle_2"
data-name="Rectangle 2"
width="0.75800002"
height="6.0669999"
transform="translate(34.584,9.404)"
x="0"
y="0" />
<rect
id="Rectangle_5"
data-name="Rectangle 5"
width="0.75800002"
height="6.0669999"
transform="translate(0.91,9.404)"
x="0"
y="0" />
<rect
id="Rectangle_3"
data-name="Rectangle 3"
width="0.75800002"
height="6.0669999"
transform="translate(34.584,18.05)"
x="0"
y="0" />
<rect
id="Rectangle_4"
data-name="Rectangle 4"
width="0.75800002"
height="6.0669999"
transform="translate(0.91,18.05)"
x="0"
y="0" />
</g>
<path
id="Union_1"
data-name="Union 1"
class="cls-4"
d="m 2.579,17.747 a 7,7 0 0 1 0.16,-1.494 9.556,9.556 0 1 1 13.634,0 6.978,6.978 0 1 1 -13.794,1.494 z"
transform="translate(8.494,4.096)"
inkscape:connector-curvature="0"
style="fill:#b72b1c" />
<path
id="Union_2"
data-name="Union 2"
d="M 2.67,16.308 A 5.374,5.374 0 0 1 3.042,14.337 8.039,8.039 0 1 1 13.064,14.315 5.388,5.388 0 1 1 2.67,16.308 Z"
transform="translate(10.011,5.534)"
inkscape:connector-curvature="0" />
<g
id="Group_3"
data-name="Group 3"
transform="translate(14.41,10.163)">
<circle
id="Ellipse_5"
data-name="Ellipse 5"
class="cls-5"
cx="3.6400001"
cy="3.6400001"
r="3.6400001"
style="fill:#f2f2f2" />
<circle
id="Ellipse_6"
data-name="Ellipse 6"
class="cls-5"
cx="1.972"
cy="1.972"
transform="translate(1.669,9.556)"
r="1.972"
style="fill:#f2f2f2" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -0,0 +1,146 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="1549 6115.496 110.729 170.038">
<defs>
<style>
.cls-1 {
fill: url(#linear-gradient);
}
.cls-2 {
fill: #f2f2f2;
}
.cls-3 {
fill: url(#linear-gradient-2);
}
.cls-4 {
fill: #3c3c3c;
}
.cls-5 {
fill: #a0b5a6;
}
.cls-6 {
fill: url(#linear-gradient-3);
}
.cls-7 {
fill: #6a6a6a;
}
.cls-8 {
fill: url(#linear-gradient-4);
}
.cls-9 {
fill: #a8a9a8;
}
.cls-10 {
fill: #9a9a9a;
}
.cls-11 {
fill: url(#linear-gradient-5);
}
.cls-12 {
fill: gray;
}
.cls-13 {
fill: #fff;
}
.cls-14 {
clip-path: url(#clip-path);
}
.cls-15 {
fill: #ffed00;
}
.cls-16 {
fill: #b72b1c;
}
.cls-17 {
fill: #1d1d1b;
}
</style>
<linearGradient id="linear-gradient" x1="0.5" y1="0.942" x2="0.5" y2="1.018" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#f2f2f2"/>
<stop offset="1" stop-color="#797979"/>
</linearGradient>
<linearGradient id="linear-gradient-2" x1="0.5" y1="0.924" x2="0.5" y2="0.948" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#a8a9a8"/>
<stop offset="1" stop-color="gray"/>
</linearGradient>
<linearGradient id="linear-gradient-3" x1="0.5" y1="0.807" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#a8a9a8"/>
<stop offset="1" stop-color="#545554"/>
</linearGradient>
<linearGradient id="linear-gradient-4" x1="0.5" y1="0.948" x2="0.5" y2="0.059" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#6a6a6a"/>
<stop offset="0.522" stop-color="#8ce300"/>
<stop offset="1" stop-color="#6a6a6a"/>
</linearGradient>
<linearGradient id="linear-gradient-5" x1="0.5" y1="0.363" x2="0.5" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#747474"/>
<stop offset="1" stop-color="#3c3c3c"/>
</linearGradient>
<clipPath id="clip-path">
<rect id="Rectangle_32" data-name="Rectangle 32" width="12.383" height="12.383"/>
</clipPath>
</defs>
<g id="EV3" transform="translate(1346 5554)">
<g id="brick" transform="translate(203 561.496)">
<path id="Path_19" data-name="Path 19" class="cls-1" d="M1.972,0H108.758a1.972,1.972,0,0,1,1.972,1.972V104.965a1.972,1.972,0,0,1-1.972,1.972H1.972A1.972,1.972,0,0,1,0,104.965V1.972A1.972,1.972,0,0,1,1.972,0Z" transform="translate(0 31.702)"/>
<path id="Path_20" data-name="Path 20" class="cls-2" d="M1.972,0H96.319a1.972,1.972,0,0,1,1.972,1.972V40.5a1.972,1.972,0,0,1-1.972,1.972H1.972A1.972,1.972,0,0,1,0,40.5V1.972A1.972,1.972,0,0,1,1.972,0Z" transform="translate(6.219 127.566)"/>
<path id="Path_18" data-name="Path 18" class="cls-3" d="M1.972,0H98.14a1.972,1.972,0,0,1,1.972,1.972V77.207a1.972,1.972,0,0,1-1.972,1.972H1.972A1.972,1.972,0,0,1,0,77.207V1.972A1.972,1.972,0,0,1,1.972,0Z" transform="translate(5.309)"/>
<path id="Path_17" data-name="Path 17" class="cls-4" d="M3.792,0H78.269a3.792,3.792,0,0,1,3.792,3.792V45.657a3.792,3.792,0,0,1-3.792,3.792H3.792A3.792,3.792,0,0,1,0,45.657V3.792A3.792,3.792,0,0,1,3.792,0Z" transform="translate(14.41 10.466)"/>
<path id="Path_16" data-name="Path 16" class="cls-5" d="M2.73,0H65.983a2.73,2.73,0,0,1,2.73,2.73V43.078a2.73,2.73,0,0,1-2.73,2.73H2.73A2.73,2.73,0,0,1,0,43.078V2.73A2.73,2.73,0,0,1,2.73,0Z" transform="translate(21.236 12.438)"/>
<path id="Path_21" data-name="Path 21" class="cls-6" d="M0,0H98.291V21.387a1.972,1.972,0,0,1-1.972,1.972H1.972A1.972,1.972,0,0,1,0,21.387Z" transform="translate(6.219 146.679)"/>
</g>
<g id="buttons" transform="translate(216.197 621.259)">
<path id="Union_4" data-name="Union 4" class="cls-7" d="M25.938,48.842c-5.585-5.391-14.259-14.258-14.259-14.258V32.764H8.267a8.266,8.266,0,1,1,0-16.533h3.413V14.41L25.786,0H39.893C46.282,6.511,54,14.107,54,14.107v2.124h3.261a8.266,8.266,0,0,1,0,16.533H54v1.821c-7.514,7.729-13.955,14.258-13.955,14.258Z" transform="translate(9.556 25.331)"/>
<path id="light" class="cls-8" d="M25.938,48.842c-5.585-5.391-14.259-14.258-14.259-14.258V32.764H8.267a8.266,8.266,0,1,1,0-16.533h3.413V14.41L25.787,0H39.893C46.282,6.511,54,14.107,54,14.107v2.124h3.261a8.266,8.266,0,0,1,0,16.533H54v1.821c-7.514,7.729-13.955,14.258-13.955,14.258Z" transform="translate(9.556 25.331)"/>
<path id="Rectangle_23" data-name="Rectangle 23" class="cls-9" d="M6.143,0h10.39a0,0,0,0,1,0,0V12.286a0,0,0,0,1,0,0H6.143A6.143,6.143,0,0,1,0,6.143v0A6.143,6.143,0,0,1,6.143,0Z" transform="translate(11.528 43.533)"/>
<path id="Rectangle_24" data-name="Rectangle 24" class="cls-9" d="M6.143,0h10.39a0,0,0,0,1,0,0V12.286a0,0,0,0,1,0,0H6.143A6.143,6.143,0,0,1,0,6.143v0A6.143,6.143,0,0,1,6.143,0Z" transform="translate(72.96 55.82) rotate(180)"/>
<path id="Path_42" data-name="Path 42" class="cls-4" d="M.455,0H12.438a.455.455,0,0,1,.455.455V11.831a.455.455,0,0,1-.455.455H.455A.455.455,0,0,1,0,11.831V.455A.455.455,0,0,1,.455,0Z" transform="translate(35.797 43.533)"/>
<path id="Path_15" data-name="Path 15" class="cls-9" d="M-98.892-1598.849l12.741-.152,9.556,9.859-3.944,3.944v7.129h-3.64v-4.1a3.058,3.058,0,0,0-3.034-3.034c-2.961-.047-11.073,0-11.073,0a2.468,2.468,0,0,0-2.579,2.578v4.551h-3.64v-7.129l-3.944-3.944Z" transform="translate(134.841 1626.455)"/>
<path id="Path_16-2" data-name="Path 16" class="cls-9" d="M9.624.095,22.286,0l9.582,9.851-4,3.907v7.17h-3.6V16.815a3.065,3.065,0,0,0-3.026-3.058c-2.961-.047-11.011,0-11.011,0a2.6,2.6,0,0,0-2.65,2.65v4.521H3.907v-7.17L0,9.851Z" transform="translate(58.26 71.876) rotate(180)"/>
<rect id="Rectangle_26" data-name="Rectangle 26" class="cls-4" width="3.034" height="13.803" transform="translate(40.803)"/>
<rect id="Rectangle_10" data-name="Rectangle 10" class="cls-10" width="3.034" height="6.067" transform="translate(40.803 13.197)"/>
<rect id="Rectangle_12" data-name="Rectangle 12" class="cls-11" width="3.034" height="6.219" transform="translate(40.803 13.197)"/>
<rect id="Rectangle_11" data-name="Rectangle 11" class="cls-12" width="3.034" height="5.916" transform="translate(40.803 19.416)"/>
<path id="Path_15-2" data-name="Path 15" class="cls-9" d="M0,0H23.663V5.714c-2.618,2.638-5.976,5.965-5.976,5.965H1.972A1.972,1.972,0,0,1,0,9.708Z" transform="translate(0 19.416)"/>
</g>
<g id="LEGO_logo" data-name="LEGO logo" transform="translate(289.475 711.071)">
<rect id="Rectangle_31" data-name="Rectangle 31" class="cls-13" width="12.208" height="12.208" transform="translate(0.087 0.087)"/>
<g id="Group_15" data-name="Group 15">
<g id="Group_10" data-name="Group 10" class="cls-14">
<path id="Path_18-2" data-name="Path 18" class="cls-15" d="M.4,12.608H12.608V.4H.4ZM11.8,5.467a5.136,5.136,0,0,1-.24,1.179c-.437,1.267-.917,2.075-2.075,2.075a1.131,1.131,0,0,1-1.157-.7l-.044-.153L8.2,7.978A1.873,1.873,0,0,1,6.733,8.7a1.287,1.287,0,0,1-1.026-.437l-.066-.087-.066.066a1.589,1.589,0,0,1-1.157.415,1.317,1.317,0,0,1-.961-.371L3.37,8.262,3.3,8.327A1.556,1.556,0,0,1,2.191,8.7a.878.878,0,0,1-.961-.9A8.05,8.05,0,0,1,2.322,4.7a1.027,1.027,0,0,1,.917-.524.8.8,0,0,1,.568.175c.109.109.109.2.131.415l.022.284.153-.24a1.611,1.611,0,0,1,1.529-.655,1.05,1.05,0,0,1,.9.371l.044.087.066-.066a1.808,1.808,0,0,1,1.2-.393,1.52,1.52,0,0,1,1.114.371.762.762,0,0,1,.131.2l.066.109.087-.109a1.6,1.6,0,0,1,1.31-.568,1.258,1.258,0,0,1,.983.349,1.352,1.352,0,0,1,.262.961" transform="translate(-0.313 -0.313)"/>
</g>
<g id="Group_11" data-name="Group 11" class="cls-14">
<path id="Path_19-2" data-name="Path 19" class="cls-16" d="M.4,12.608H12.608V.4H.4ZM12.149,5.947a6.83,6.83,0,0,1-.524,1.594,2.28,2.28,0,0,1-2.1,1.551,1.694,1.694,0,0,1-1.354-.546,2.194,2.194,0,0,1-1.485.546A1.764,1.764,0,0,1,5.6,8.742a2.182,2.182,0,0,1-1.223.349,1.781,1.781,0,0,1-1.026-.306,2.2,2.2,0,0,1-1.179.306A1.285,1.285,0,0,1,.815,7.847,8.327,8.327,0,0,1,1.994,4.506a1.407,1.407,0,0,1,1.245-.743c.59,0,.786.175.9.371A2.259,2.259,0,0,1,5.6,3.741a1.5,1.5,0,0,1,1,.328,2.393,2.393,0,0,1,1.2-.306,1.731,1.731,0,0,1,1.354.459,2.039,2.039,0,0,1,1.332-.437,1.566,1.566,0,0,1,1.376.611,1.8,1.8,0,0,1,.284,1.551" transform="translate(-0.313 -0.313)"/>
</g>
<g id="Group_12" data-name="Group 12" class="cls-14">
<path id="Path_20-2" data-name="Path 20" class="cls-17" d="M0,12.383H12.383V0H0Zm12.208-.175H.175V.175H12.208Z"/>
</g>
<g id="Group_13" data-name="Group 13" class="cls-14">
<path id="Path_21-2" data-name="Path 21" class="cls-17" d="M52.962,15.984V15.9h.066c.044,0,.066.022.066.044s-.022.044-.066.044Zm.2.175-.044-.066q-.033-.066-.066-.066h0a.094.094,0,0,0,.087-.087.08.08,0,0,0-.087-.087H52.9v.306h.066v-.131h.022c.022,0,.044,0,.044.022.022.022.022.044.044.066l.022.044Zm-.153-.393a.24.24,0,1,1-.24.24.258.258,0,0,1,.24-.24m0-.066a.306.306,0,1,0,.306.306.312.312,0,0,0-.306-.306" transform="translate(-41.191 -12.271)"/>
</g>
<g id="Group_14" data-name="Group 14" class="cls-14">
<path id="Path_22" data-name="Path 22" class="cls-17" d="M13.189,17.122a1.713,1.713,0,0,0-1.376.611.557.557,0,0,0-.153-.218A1.442,1.442,0,0,0,10.5,17.1a1.858,1.858,0,0,0-1.245.415A1.089,1.089,0,0,0,8.3,17.1a1.68,1.68,0,0,0-1.594.7.539.539,0,0,0-.153-.459.883.883,0,0,0-.633-.2,1.1,1.1,0,0,0-.983.568A8.8,8.8,0,0,0,3.8,20.878a.966.966,0,0,0,1.048.961,1.516,1.516,0,0,0,1.179-.393,1.316,1.316,0,0,0,1,.393,1.582,1.582,0,0,0,1.223-.459,1.378,1.378,0,0,0,1.092.459,1.913,1.913,0,0,0,1.529-.764,1.2,1.2,0,0,0,1.245.743c1.2,0,1.725-.83,2.162-2.118a4.449,4.449,0,0,0,.262-1.2,1.207,1.207,0,0,0-1.354-1.376M5.218,20.4c.611-.109.786.109.764.328-.066.611-.633.764-1.114.743a.626.626,0,0,1-.7-.59,8.208,8.208,0,0,1,1.07-2.97.709.709,0,0,1,.677-.393c.306,0,.371.153.371.328A14.253,14.253,0,0,1,5.218,20.4m2.009-.568c-.044.109-.109.349-.175.59a2.42,2.42,0,0,1,.611-.087c.306,0,.48.131.48.371,0,.59-.655.764-1.114.764a.845.845,0,0,1-.939-.83,6.135,6.135,0,0,1,.677-2.271,1.372,1.372,0,0,1,1.529-.9c.306,0,.677.131.677.437,0,.415-.349.568-.677.59a3.851,3.851,0,0,1-.5,0,3.871,3.871,0,0,0-.24.48c.633-.087.9.044.786.415-.153.5-.59.524-1.114.437m3.123-1.551a.472.472,0,0,0-.371.218,6.165,6.165,0,0,0-.633,1.725c-.044.284.087.349.218.349.218,0,.459-.24.546-.611,0,0-.415,0-.306-.371s.328-.437.677-.459c.7-.022.633.48.568.764a1.8,1.8,0,0,1-1.7,1.594.89.89,0,0,1-.983-.961,4.914,4.914,0,0,1,.393-1.551c.371-.874.764-1.485,1.769-1.485.59,0,1.07.218,1,.764a.658.658,0,0,1-.633.677c-.109,0-.524,0-.393-.415.022-.131.044-.24-.153-.24m3.756.743a7.171,7.171,0,0,1-.59,1.616,1.409,1.409,0,0,1-1.376.852c-.437,0-.939-.175-.939-.852A5.286,5.286,0,0,1,11.595,19c.306-.83.633-1.507,1.66-1.485,1.157,0,.939,1.048.852,1.507m-.852-.524a9.808,9.808,0,0,1-.633,1.856.328.328,0,0,1-.306.218c-.131,0-.175-.087-.2-.2a7.657,7.657,0,0,1,.7-1.944c.087-.131.175-.153.262-.131.175,0,.175.109.175.2" transform="translate(-2.969 -13.366)"/>
</g>
</g>
</g>
<g id="EV3_logo" data-name="EV3 logo" transform="translate(215.286 714.697)">
<path id="Path_12" data-name="Path 12" class="cls-2" d="M72.066,1.849a.183.183,0,0,1,.191.164h0v.847A.153.153,0,0,1,72.094,3H70.071a.366.366,0,0,0-.383.328V4.473a.346.346,0,0,0,.383.3h2.023c.191,0,.164.137.164.137v.82c0,.082-.055.137-.164.137H68.677a.187.187,0,0,1-.191-.191V5.621a.391.391,0,0,0-.383-.383H66.983a.391.391,0,0,0-.383.383v1.64a.366.366,0,0,0,.383.328h6.751a.346.346,0,0,0,.383-.3V.4a.346.346,0,0,0-.383-.3H67.01a.346.346,0,0,0-.383.3V2.068a.387.387,0,0,0,.355.383H68.1a.362.362,0,0,0,.355-.355V2.041a.173.173,0,0,1,.191-.191h3.417Z" transform="translate(-48.397 -0.073)"/>
<path id="Path_13" data-name="Path 13" class="cls-2" d="M39.03,0H37.445c-.246,0-.328.164-.437.383L35.067,4.756a.23.23,0,0,1-.191.109.206.206,0,0,1-.191-.137L32.744.383C32.635.164,32.525,0,32.279,0H30.667c-.355,0-.41.191-.3.41l3.2,6.724c.164.328.273.383.574.383h1.421a.546.546,0,0,0,.574-.383L39.358.41c.109-.219.027-.41-.328-.41" transform="translate(-22.029)"/>
<path id="Path_14" data-name="Path 14" class="cls-2" d="M7.106,2.97a.346.346,0,0,1,.383.3V4.446a.346.346,0,0,1-.383.3H2.05c-.109,0-.191.055-.191.137h0V5.7h0c0,.082.082.137.191.137H7.106a.346.346,0,0,1,.383.3V7.288a.336.336,0,0,1-.355.3H.383A.346.346,0,0,1,0,7.288V.4A.346.346,0,0,1,.383.1H7.134a.319.319,0,0,1,.355.3V1.549a.319.319,0,0,1-.355.3H2.077c-.109,0-.219.027-.219.137v.847c0,.082.082.137.191.137Z" transform="translate(0 -0.073)"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,650 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="2135.306 6140.141 153.634 153.634"
version="1.1"
id="svg7024"
sodipodi:docname="Large Motor.svg"
width="153.634"
height="153.634"
inkscape:version="0.92.1 r15371"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\motorLarge-icon.png"
inkscape:export-xdpi="74.983398"
inkscape:export-ydpi="74.983398">
<metadata
id="metadata7028">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="837"
id="namedview7026"
showgrid="false"
inkscape:zoom="1.5361183"
inkscape:cx="39.260502"
inkscape:cy="76.817001"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg7024" />
<defs
id="defs6971">
<style
id="style6897">
.cls-1 {
fill: #a8a9a8;
}
.cls-2 {
clip-path: url(#clip-path);
}
.cls-3 {
fill: #fff;
}
.cls-4 {
clip-path: url(#clip-path-2);
}
.cls-5 {
fill: #f2f2f2;
}
.cls-6 {
clip-path: url(#clip-path-3);
}
.cls-7 {
fill: #6a6a6a;
}
.cls-8 {
fill: #9a9a9a;
}
.cls-9 {
fill: #b72b1c;
}
.cls-10 {
fill: #3c3c3c;
}
.cls-11 {
fill: #242424;
}
.cls-12 {
filter: url(#rød);
}
.cls-13 {
filter: url(#Path_4);
}
.cls-14 {
filter: url(#Path_1-2);
}
.cls-15 {
filter: url(#Path_2);
}
.cls-16 {
filter: url(#Path_1);
}
.cls-17 {
filter: url(#Path_34);
}
</style>
<clipPath
id="clip-path">
<path
id="Union_6"
data-name="Union 6"
class="cls-1"
d="M 0,136.571 A 17.07,17.07 0 0 1 14.122,119.759 L 13.757,119.371 13.747,83.6 c 0,-0.419 0.142,-0.4 0.392,-0.673 L 25.043,72.4 V 62.372 l -0.75,-0.775 V 60.8 H 17.5 a 4,4 0 0 1 -4,-4 V 30.978 a 4,4 0 0 1 4,-4 h 6.793 V 18.8 a 5.784,5.784 0 0 1 5.784,-5.784 h 6.508 V 5.446 A 4,4 0 0 1 39.477,1.6 v -1 A 0.607,0.607 0 0 1 40.084,0 h 26.262 a 0.607,0.607 0 0 1 0.607,0.607 v 1.282 a 4,4 0 0 1 2.169,3.557 v 7.569 h 3.615 A 5.784,5.784 0 0 1 78.521,18.8 V 48.44 C 68.153,62.5 60.394,72.305 60.394,72.305 H 59.8 c 0,0 -7.092,-0.053 -13.682,-0.1 l 0.034,11.8 h 6.882 a 4,4 0 0 1 4,4 v 25.826 a 4,4 0 0 1 -4,4 h -6.785 l 0.034,11.775 c 0,0.838 -0.155,0.838 -0.462,1.137 l -10.415,10.099 -0.212,0.191 A 1.518,1.518 0 0 1 33.6,140.8 17.067,17.067 0 0 1 0,136.571 Z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</clipPath>
<filter
id="Path_34"
x="2168.8911"
y="6138.5869"
width="38.536999"
height="21.907"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset6901" />
<feGaussianBlur
stdDeviation="1"
result="blur"
id="feGaussianBlur6903" />
<feFlood
flood-opacity="0.502"
id="feFlood6905" />
<feComposite
operator="in"
in2="blur"
id="feComposite6907"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite6909" />
</filter>
<filter
id="Path_1"
x="2146.053"
y="6207.1338"
width="38.536999"
height="77.177002"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset6912" />
<feGaussianBlur
stdDeviation="1"
result="blur-2"
id="feGaussianBlur6914" />
<feFlood
flood-opacity="0.502"
id="feFlood6916" />
<feComposite
operator="in"
in2="blur-2"
id="feComposite6918"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite6920" />
</filter>
<filter
id="Path_2"
x="2157.3491"
y="6198.8062"
width="27.028999"
height="28.403"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset6923" />
<feGaussianBlur
stdDeviation="1"
result="blur-3"
id="feGaussianBlur6925" />
<feFlood
flood-opacity="0.502"
id="feFlood6927" />
<feComposite
operator="in"
in2="blur-3"
id="feComposite6929"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite6931" />
</filter>
<filter
id="Path_1-2"
x="2156.6001"
y="6150.1548"
width="60.229"
height="65.290001"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset6934" />
<feGaussianBlur
stdDeviation="1"
result="blur-4"
id="feGaussianBlur6936" />
<feFlood
flood-opacity="0.502"
id="feFlood6938" />
<feComposite
operator="in"
in2="blur-4"
id="feComposite6940"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite6942" />
</filter>
<clipPath
id="clip-path-2">
<path
id="Path_9"
data-name="Path 9"
class="cls-1"
d="m 5.784,0 h 42.66 a 5.784,5.784 0 0 1 5.784,5.784 v 29.64 C 43.86,49.487 36.1,59.29 36.1,59.29 h -0.595 c 0,0 -19.462,-0.147 -23.864,-0.147 A 2.28,2.28 0 0 1 9.263,58.158 L 0,48.582 V 5.784 A 5.784,5.784 0 0 1 5.784,0 Z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</clipPath>
<filter
id="Path_4"
x="2162.384"
y="6155.2168"
width="48.66"
height="54.444"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset6947" />
<feGaussianBlur
stdDeviation="1"
result="blur-5"
id="feGaussianBlur6949" />
<feFlood
flood-opacity="0.502"
id="feFlood6951" />
<feComposite
operator="in"
in2="blur-5"
id="feComposite6953"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite6955" />
</filter>
<clipPath
id="clip-path-3">
<path
id="Path_10"
data-name="Path 10"
class="cls-1"
d="M 5.784,0 H 36.875 A 5.784,5.784 0 0 1 42.66,5.784 V 28.032 C 34.013,39.3 27.1,48.444 27.1,48.444 H 5.784 A 5.784,5.784 0 0 1 0,42.66 V 5.784 A 5.784,5.784 0 0 1 5.784,0 Z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</clipPath>
<filter
id="rød"
x="2132.3059"
y="6256.646"
width="40.129002"
height="40.129002"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset6960" />
<feGaussianBlur
stdDeviation="1"
result="blur-6"
id="feGaussianBlur6962" />
<feFlood
flood-opacity="0.502"
id="feFlood6964" />
<feComposite
operator="in"
in2="blur-6"
id="feComposite6966"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite6968" />
</filter>
</defs>
<g
id="Large_Motor"
data-name="Large Motor"
transform="translate(1383.553,5554.0014)">
<g
id="Mask_Group_6"
data-name="Mask Group 6"
class="cls-2"
transform="translate(789.306,586.141)"
clip-path="url(#clip-path)">
<g
id="Large_motor-2"
data-name="Large motor"
transform="translate(-1.623)">
<path
id="Path_45"
data-name="Path 45"
class="cls-1"
d="m 5.461,0 h 5.612 a 5.461,5.461 0 0 1 5.461,5.461 v 22.9 a 5.461,5.461 0 0 1 -5.461,5.461 H 5.461 A 5.461,5.461 0 0 1 0,28.365 V 5.461 A 5.461,5.461 0 0 1 5.461,0 Z"
transform="translate(42.123,84.012)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
<circle
id="Ellipse_2"
data-name="Ellipse 2"
class="cls-3"
cx="3.7920001"
cy="3.7920001"
transform="translate(49.555,85.528)"
r="3.7920001"
style="fill:#ffffff" />
<circle
id="Ellipse_1"
data-name="Ellipse 1"
class="cls-3"
cx="3.7920001"
cy="3.7920001"
transform="translate(49.555,108.736)"
r="3.7920001"
style="fill:#ffffff" />
<path
id="Path_36"
data-name="Path 36"
class="cls-1"
d="m 0.607,0 h 26.262 a 0.607,0.607 0 0 1 0.607,0.607 V 5.9 A 0.607,0.607 0 0 1 26.869,6.507 H 0.607 A 0.607,0.607 0 0 1 0,5.9 V 0.607 A 0.607,0.607 0 0 1 0.607,0 Z"
transform="translate(41.1)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
<g
class="cls-17"
transform="translate(-2133.68,-6140.14)"
id="g6978"
style="filter:url(#Path_34)">
<path
id="Path_34-2"
data-name="Path 34"
class="cls-1"
d="M 0.607,0 H 31.93 a 0.607,0.607 0 0 1 0.607,0.607 V 15.3 A 0.607,0.607 0 0 1 31.93,15.907 H 0.607 A 0.607,0.607 0 0 1 0,15.3 V 0.607 A 0.607,0.607 0 0 1 0.607,0 Z"
transform="translate(2171.89,6141.59)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</g>
<path
id="Path_2-2"
data-name="Path 2"
class="cls-3"
d="m 5610.158,939.234 a 4.151,4.151 0 0 1 -2.342,0.705 5.131,5.131 0 0 1 -2.988,-0.705 c -1.257,-0.931 -1.229,0.1 -1.229,0.1 v 1.8 c 0,0.45 0.553,0.846 1.229,0.459 0.676,-0.387 1,-0.581 1,-0.581 0,0 0.361,-0.184 0.361,0.335 v 2.62 c 0,0 0.021,0.786 -0.73,0.768 -0.751,-0.018 -1.38,0 -1.38,0 0,0 -0.293,0.248 -0.293,1.385 0,1.137 0.293,1.322 0.293,1.322 h 1.38 c 0,0 0.73,-0.024 0.73,0.649 v 1.3 c 0,0 0.227,0.359 1.169,0.306 a 3.6,3.6 0 0 0 1.4,-0.306 v -1.3 a 0.67,0.67 0 0 1 0.66,-0.649 c 0.631,-0.01 1.257,0 1.257,0 0,0 0.252,-0.191 0.287,-1.322 0.035,-1.131 -0.287,-1.385 -0.287,-1.385 h -1.257 c 0,0 -0.805,-0.052 -0.817,-0.768 -0.012,-0.716 0,-2.62 0,-2.62 0,0 -0.047,-0.515 0.332,-0.335 0.379,0.18 1.215,0.581 1.215,0.581 0,0 0.83,0.407 0.814,-0.459 -0.016,-0.866 0,-1.8 0,-1.8 0,0 -0.072,-0.534 -0.804,-0.1 z"
transform="translate(-5553.893,-845.301)"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
<path
id="Path_3"
data-name="Path 3"
class="cls-3"
d="m 5601.9,1015.336 a 0.83,0.83 0 0 1 1.2,-0.594 6.516,6.516 0 0 0 2.85,0.772 5.05,5.05 0 0 0 2.768,-0.772 c 0.829,-0.4 1.067,0.594 1.067,0.594 v 1.76 a 0.71,0.71 0 0 1 -1.067,0.561 5.791,5.791 0 0 0 -2.768,-0.837 7.06,7.06 0 0 0 -2.85,0.837 c 0,0 -1.178,0.239 -1.2,-0.561 -0.022,-0.8 0,-1.76 0,-1.76 z"
transform="translate(-5552.485,-909.604)"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
<g
class="cls-16"
transform="translate(-2133.68,-6140.14)"
id="g6983"
style="filter:url(#Path_1)">
<path
id="Path_1-3"
data-name="Path 1"
class="cls-1"
d="M 0.016,8.513 13.42,-4.416 31.991,-3.746 32.162,55.2 c 0,0.838 -0.155,0.838 -0.462,1.137 l -10.416,10.096 -0.212,0.19 c -0.584,0.4 -1.987,-0.115 -1.987,-0.952 L -0.364,44.961 -0.375,9.187 c 0,-0.419 0.142,-0.402 0.391,-0.674 z"
transform="translate(2149.43,6214.55)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</g>
<g
class="cls-15"
transform="translate(-2133.68,-6140.14)"
id="g6986"
style="filter:url(#Path_2)">
<path
id="Path_2-3"
data-name="Path 2"
class="cls-1"
d="m 1484.037,521.285 v 17.253 c 0,0 0.019,0.845 0.3,1.121 0.281,0.276 3.516,3.626 3.516,3.626 a 1.566,1.566 0 0 0 1.157,0.4 c 0.758,-0.025 11.627,0 11.627,0 l 4.429,-4.7 v -7.963 l -10.662,-0.567 z"
transform="translate(676.31,5680.52)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</g>
<g
id="Group_4"
data-name="Group 4"
transform="translate(15.123,26.978)">
<path
id="Path_44"
data-name="Path 44"
class="cls-1"
d="m 5.461,0 h 5.612 a 5.461,5.461 0 0 1 5.461,5.461 v 22.9 a 5.461,5.461 0 0 1 -5.461,5.461 H 5.461 A 5.461,5.461 0 0 1 0,28.365 V 5.461 A 5.461,5.461 0 0 1 5.461,0 Z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
<circle
id="Ellipse_3"
data-name="Ellipse 3"
class="cls-3"
cx="3.7920001"
cy="3.7920001"
transform="translate(1.062,1.517)"
r="3.7920001"
style="fill:#ffffff" />
<circle
id="Ellipse_4"
data-name="Ellipse 4"
class="cls-3"
cx="3.7920001"
cy="3.7920001"
transform="translate(1.062,24.725)"
r="3.7920001"
style="fill:#ffffff" />
<path
id="Path_5"
data-name="Path 5"
class="cls-3"
d="m 5610.158,939.234 a 4.151,4.151 0 0 1 -2.342,0.705 5.131,5.131 0 0 1 -2.988,-0.705 c -1.257,-0.931 -1.229,0.1 -1.229,0.1 v 1.8 c 0,0.45 0.553,0.846 1.229,0.459 0.676,-0.387 1,-0.581 1,-0.581 0,0 0.361,-0.184 0.361,0.335 v 2.62 c 0,0 0.021,0.786 -0.73,0.768 -0.751,-0.018 -1.38,0 -1.38,0 0,0 -0.293,0.248 -0.293,1.385 0,1.137 0.293,1.322 0.293,1.322 h 1.38 c 0,0 0.73,-0.024 0.73,0.649 v 1.3 c 0,0 0.227,0.359 1.169,0.306 a 3.6,3.6 0 0 0 1.4,-0.306 v -1.3 a 0.67,0.67 0 0 1 0.66,-0.649 c 0.631,-0.01 1.257,0 1.257,0 0,0 0.252,-0.191 0.287,-1.322 0.035,-1.131 -0.287,-1.385 -0.287,-1.385 h -1.257 c 0,0 -0.805,-0.052 -0.817,-0.768 -0.012,-0.716 0,-2.62 0,-2.62 0,0 -0.047,-0.515 0.332,-0.335 0.379,0.18 1.215,0.581 1.215,0.581 0,0 0.83,0.407 0.814,-0.459 -0.016,-0.866 0,-1.8 0,-1.8 0,0 -0.072,-0.534 -0.804,-0.1 z"
transform="translate(-5602.386,-929.312)"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
<path
id="Path_6"
data-name="Path 6"
class="cls-3"
d="m 5601.9,1015.336 a 0.83,0.83 0 0 1 1.2,-0.594 6.516,6.516 0 0 0 2.85,0.772 5.05,5.05 0 0 0 2.768,-0.772 c 0.829,-0.4 1.067,0.594 1.067,0.594 v 1.76 a 0.71,0.71 0 0 1 -1.067,0.561 5.791,5.791 0 0 0 -2.768,-0.837 7.06,7.06 0 0 0 -2.85,0.837 c 0,0 -1.178,0.239 -1.2,-0.561 -0.022,-0.8 0,-1.76 0,-1.76 z"
transform="translate(-5600.979,-993.616)"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
</g>
<g
class="cls-14"
transform="translate(-2133.68,-6140.14)"
id="g6995"
style="filter:url(#Path_1-2)">
<path
id="Path_1-4"
data-name="Path 1"
class="cls-1"
d="m 5.784,0 h 42.66 a 5.784,5.784 0 0 1 5.784,5.784 v 29.64 C 43.86,49.487 36.1,59.29 36.1,59.29 h -0.595 c 0,0 -19.462,-0.147 -23.864,-0.147 A 2.28,2.28 0 0 1 9.263,58.158 L 0,48.582 V 5.784 A 5.784,5.784 0 0 1 5.784,0 Z"
transform="translate(2159.6,6153.16)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</g>
<g
id="hvid"
transform="translate(25.916,13.015)">
<g
id="Mask_Group_1"
data-name="Mask Group 1"
class="cls-4"
clip-path="url(#clip-path-2)">
<path
id="hvid-2"
data-name="hvid"
class="cls-5"
d="m 1498.578,449.051 7.155,7.37 23.789,31.08 v 14.857 l 13.063,-16.131 v -31.221 l -0.993,-7.691 z"
transform="translate(-1487.315,-449.455)"
inkscape:connector-curvature="0"
style="fill:#f2f2f2" />
</g>
</g>
<g
class="cls-13"
transform="translate(-2133.68,-6140.14)"
id="g7001"
style="filter:url(#Path_4)">
<path
id="Path_4-2"
data-name="Path 4"
class="cls-1"
d="M 5.784,0 H 36.875 A 5.784,5.784 0 0 1 42.66,5.784 V 28.032 C 34.013,39.3 27.1,48.444 27.1,48.444 H 5.784 A 5.784,5.784 0 0 1 0,42.66 V 5.784 A 5.784,5.784 0 0 1 5.784,0 Z"
transform="translate(2165.38,6158.22)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</g>
<g
id="Group_3"
data-name="Group 3"
transform="translate(31.7,18.38)">
<g
id="Mask_Group_2"
data-name="Mask Group 2"
class="cls-6"
clip-path="url(#clip-path-3)">
<path
id="Union_1"
data-name="Union 1"
class="cls-7"
d="M 14.461,28.56 V 1.085 a 1.085,1.085 0 1 1 2.169,0 V 28.56 a 1.085,1.085 0 1 1 -2.169,0 z m -3.615,0 V 1.085 a 1.085,1.085 0 1 1 2.169,0 V 28.56 a 1.085,1.085 0 1 1 -2.169,0 z m -3.615,0 V 1.085 a 1.085,1.085 0 1 1 2.169,0 V 28.56 a 1.085,1.085 0 1 1 -2.169,0 z m -3.615,0 V 1.085 a 1.085,1.085 0 1 1 2.169,0 V 28.56 a 1.085,1.085 0 1 1 -2.169,0 z M 0,28.56 V 1.085 a 1.085,1.085 0 1 1 2.169,0 V 28.56 A 1.085,1.085 0 1 1 0,28.56 Z"
transform="translate(15.907,-5.365)"
inkscape:connector-curvature="0"
style="fill:#6a6a6a" />
</g>
</g>
<circle
id="Ellipse_1-2"
data-name="Ellipse 1"
class="cls-8"
cx="2.2449999"
cy="2.2449999"
transform="translate(29.076,16.175)"
r="2.2449999"
style="fill:#9a9a9a" />
<circle
id="Ellipse_2-2"
data-name="Ellipse 2"
class="cls-8"
cx="2.2449999"
cy="2.2449999"
transform="translate(57.744,66.686)"
r="2.2449999"
style="fill:#9a9a9a" />
<g
class="cls-12"
transform="translate(-2133.68,-6140.14)"
id="g7009">
<circle
id="rød-2"
data-name="rød"
class="cls-9"
cx="17.063999"
cy="17.063999"
transform="translate(2135.31,6259.65)"
r="17.063999"
style="fill:#b72b1c" />
</g>
<g
id="Group_2"
data-name="Group 2"
transform="matrix(0.966,0.259,-0.259,0.966,7.93,117.883)">
<circle
id="Ellipse_4-2"
data-name="Ellipse 4"
class="cls-10"
cx="3.7920001"
cy="3.7920001"
transform="translate(11.528)"
r="3.7920001"
style="fill:#3c3c3c" />
<circle
id="Ellipse_7"
data-name="Ellipse 7"
class="cls-10"
cx="3.7920001"
cy="3.7920001"
transform="translate(23.056,11.528)"
r="3.7920001"
style="fill:#3c3c3c" />
<circle
id="Ellipse_5"
data-name="Ellipse 5"
class="cls-10"
cx="3.7920001"
cy="3.7920001"
transform="translate(11.528,23.056)"
r="3.7920001"
style="fill:#3c3c3c" />
<circle
id="Ellipse_6"
data-name="Ellipse 6"
class="cls-10"
cx="3.7920001"
cy="3.7920001"
transform="translate(0,11.528)"
r="3.7920001"
style="fill:#3c3c3c" />
<path
id="Path_4-3"
data-name="Path 4"
class="cls-11"
d="m 2.4,1.566 c 0,0 0.021,0.786 -0.73,0.768 -0.751,-0.018 -1.38,0 -1.38,0 0,0 -0.29,0.248 -0.29,1.385 0,1.137 0.294,1.322 0.294,1.322 h 1.38 c 0,0 0.73,-0.024 0.73,0.649 0,0.673 0,1.3 0,1.3 0,0 0.227,0.359 1.17,0.306 a 3.594,3.594 0 0 0 1.4,-0.306 v -1.3 a 0.67,0.67 0 0 1 0.66,-0.649 c 0.631,-0.01 1.257,0 1.257,0 0,0 0.253,-0.191 0.287,-1.322 C 7.212,2.588 6.891,2.333 6.891,2.333 H 5.638 c 0,0 -0.806,-0.052 -0.818,-0.768 A 12.478,12.478 0 0 1 4.884,0.305 2.9,2.9 0 0 0 2.529,0.213 C 2.45,0.819 2.4,1.566 2.4,1.566 Z"
transform="rotate(-90,15.2715,3.5915)"
inkscape:connector-curvature="0"
style="fill:#242424" />
<path
id="Path_5-2"
data-name="Path 5"
class="cls-10"
d="M 0.455,0.155 2.016,0 3.64,0.155 A 0.455,0.455 0 0 1 4.1,0.61 V 2.734 A 0.455,0.455 0 0 1 3.645,3.189 L 2.094,2.979 0.46,3.189 A 0.455,0.455 0 0 1 0,2.734 V 0.61 A 0.455,0.455 0 0 1 0.455,0.155 Z"
transform="translate(13.241,8.084)"
inkscape:connector-curvature="0"
style="fill:#3c3c3c" />
<path
id="Path_7"
data-name="Path 7"
class="cls-10"
d="M 0.455,0.155 2.016,0 3.64,0.155 A 0.455,0.455 0 0 1 4.1,0.61 V 2.734 A 0.455,0.455 0 0 1 3.645,3.189 L 2.094,2.979 0.46,3.189 A 0.455,0.455 0 0 1 0,2.734 V 0.61 A 0.455,0.455 0 0 1 0.455,0.155 Z"
transform="rotate(-90,12.71,4.628)"
inkscape:connector-curvature="0"
style="fill:#3c3c3c" />
<path
id="Path_6-2"
data-name="Path 6"
class="cls-10"
d="M 0.455,0.155 2.016,0 3.64,0.155 A 0.455,0.455 0 0 1 4.1,0.61 V 2.734 A 0.455,0.455 0 0 1 3.645,3.189 L 2.094,2.979 0.46,3.189 A 0.455,0.455 0 0 1 0,2.734 V 0.61 A 0.455,0.455 0 0 1 0.455,0.155 Z"
transform="rotate(180,8.668,11.2485)"
inkscape:connector-curvature="0"
style="fill:#3c3c3c" />
<path
id="Path_8"
data-name="Path 8"
class="cls-10"
d="M 0.455,0.155 2.016,0 3.64,0.155 A 0.455,0.455 0 0 1 4.1,0.61 V 2.734 A 0.455,0.455 0 0 1 3.645,3.189 L 2.094,2.979 0.46,3.189 A 0.455,0.455 0 0 1 0,2.734 V 0.61 A 0.455,0.455 0 0 1 0.455,0.155 Z"
transform="rotate(90,4.6265,17.8685)"
inkscape:connector-curvature="0"
style="fill:#3c3c3c" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="1719.858 6177.276 47.14 47.14"
version="1.1"
id="svg7610"
sodipodi:docname="Medium Motor.svg"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\motorMedium-icon.png"
inkscape:export-xdpi="244.37845"
inkscape:export-ydpi="244.37845"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata7614">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1137"
id="namedview7612"
showgrid="false"
inkscape:zoom="5.0063641"
inkscape:cx="23.57"
inkscape:cy="23.57"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg7610" />
<defs
id="defs7591">
<style
id="style7573">
.cls-1 {
fill: url(#linear-gradient);
}
.cls-2 {
fill: #a8a9a8;
}
.cls-3 {
fill: #3c3c3c;
}
.cls-4 {
fill: #b72b1c;
stroke: #8b1104;
stroke-width: 0.25px;
}
.cls-5 {
stroke: none;
}
.cls-6 {
fill: none;
}
.cls-7 {
filter: url(#Union_1);
}
</style>
<linearGradient
id="linear-gradient"
x1="0.5"
y1="0.919"
x2="0.5"
y2="1.077"
gradientUnits="objectBoundingBox">
<stop
offset="0"
stop-color="#a8a9a8"
id="stop7575" />
<stop
offset="1"
stop-color="#545554"
id="stop7577" />
</linearGradient>
<filter
id="Union_1"
x="1719.858"
y="6177.276"
width="47.14"
height="47.14"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset7580" />
<feGaussianBlur
stdDeviation="0.5"
result="blur"
id="feGaussianBlur7582" />
<feFlood
flood-opacity="0.322"
id="feFlood7584" />
<feComposite
operator="in"
in2="blur"
id="feComposite7586"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite7588" />
</filter>
</defs>
<g
id="Medium_Motor"
data-name="Medium Motor"
transform="translate(1346 5554)">
<g
id="Group_4"
data-name="Group 4"
transform="translate(375.358 624.776)">
<path
id="Path_1"
data-name="Path 1"
class="cls-1"
d="M3.281-.287h39a2.357,2.357,0,0,1,2.57,1.972V42.033c0,1-1.1,1.82-2.57,1.82h-39c-1.473,0-2.57-.815-2.57-1.82V1.685A2.357,2.357,0,0,1,3.281-.287Z"
transform="translate(-0.711 0.287)" />
</g>
<g
id="Group_7"
data-name="Group 7"
transform="translate(419.498 624.776) rotate(90)">
<g
class="cls-7"
transform="matrix(0, -1, 1, 0, -6178.78, 1765.5)"
id="g7596">
<path
id="Union_1-2"
data-name="Union 1"
class="cls-2"
d="M21.236,44.14a6.219,6.219,0,0,1-6.219-6.219v-8.8h-8.8A6.219,6.219,0,0,1,0,22.9V21.236a6.219,6.219,0,0,1,6.219-6.219h8.8v-8.8A6.219,6.219,0,0,1,21.236,0H22.9a6.219,6.219,0,0,1,6.219,6.219v8.8h8.8a6.219,6.219,0,0,1,6.219,6.219V22.9a6.219,6.219,0,0,1-6.219,6.219h-8.8v8.8A6.219,6.219,0,0,1,22.9,44.14Z"
transform="translate(1765.5 6178.78) rotate(90)" />
</g>
<ellipse
id="Ellipse_1"
data-name="Ellipse 1"
class="cls-3"
cx="4.854"
cy="4.854"
rx="4.854"
ry="4.854"
transform="translate(17.292 1.517)" />
<ellipse
id="Ellipse_2"
data-name="Ellipse 2"
class="cls-3"
cx="4.854"
cy="4.854"
rx="4.854"
ry="4.854"
transform="translate(17.292 32.915)" />
<ellipse
id="Ellipse_1-2"
data-name="Ellipse 1"
class="cls-3"
cx="4.854"
cy="4.854"
rx="4.854"
ry="4.854"
transform="translate(1.517 26.848) rotate(-90)" />
<ellipse
id="Ellipse_2-2"
data-name="Ellipse 2"
class="cls-3"
cx="4.854"
cy="4.854"
rx="4.854"
ry="4.854"
transform="translate(32.915 26.848) rotate(-90)" />
</g>
<g
id="Ellipse_4"
data-name="Ellipse 4"
class="cls-4"
transform="translate(390.903 640.17)">
<ellipse
class="cls-5"
cx="6.752"
cy="6.752"
rx="6.752"
ry="6.752"
id="ellipse7603" />
<ellipse
class="cls-6"
cx="6.752"
cy="6.752"
rx="6.627"
ry="6.627"
id="ellipse7605" />
</g>
<path
id="Hole"
d="M5606.437,962.413s-.054,1.021-.769,1.029-1.461,0-1.461,0a2.363,2.363,0,0,0-.455,1.691c0,1.266.357,1.6.357,1.6h1.628a.645.645,0,0,1,.7.7V969.1a3.882,3.882,0,0,0,1.766.287,6.459,6.459,0,0,0,1.676-.287v-1.667a.73.73,0,0,1,.734-.7,10.674,10.674,0,0,0,1.444-.14s.4-.374.434-1.632-.353-1.644-.353-1.644h-1.693a.641.641,0,0,1-.762-.678,11.41,11.41,0,0,1,0-1.643,4.815,4.815,0,0,0-3.246,0C5606.42,961.694,5606.437,962.413,5606.437,962.413Z"
transform="translate(-5210.486 -318.186)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,347 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="1827.391 6183.664 36.101 36.101003"
version="1.1"
id="svg4572"
sodipodi:docname="Touch sensor.svg"
width="36.101002"
height="36.101002"
inkscape:version="0.92.1 r15371"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\touchSensor-icon.png"
inkscape:export-xdpi="319.10471"
inkscape:export-ydpi="319.10471">
<metadata
id="metadata4576">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="837"
id="namedview4574"
showgrid="false"
inkscape:zoom="7.0722208"
inkscape:cx="18.050501"
inkscape:cy="16.684999"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg4572" />
<defs
id="defs4547">
<style
id="style4522">
.cls-1 {
fill: #a8a9a8;
}
.cls-2 {
clip-path: url(#clip-path);
}
.cls-3 {
fill: url(#linear-gradient);
}
.cls-4 {
fill: url(#linear-gradient-2);
}
.cls-5 {
fill: #b72b1c;
stroke: #8b1104;
stroke-width: 0.25px;
}
.cls-6 {
stroke: none;
}
.cls-7 {
fill: none;
}
.cls-8 {
filter: url(#Path_1);
}
</style>
<clipPath
id="clip-path">
<path
id="Union_3"
data-name="Union 3"
class="cls-1"
d="m 3.944,33.37 c -1.069,0 -1.972,-0.6 -1.972,-1.365 v -4.4 H 1 a 1,1 0 0 1 -1,-1 V 7.371 a 1,1 0 0 1 1,-1 H 1.972 V 1.365 C 1.972,0.6 2.875,0 3.944,0 h 10.769 v 1.365 h 6.371 V 0 h 11.073 c 1.069,0 1.972,0.6 1.972,1.365 V 6.371 H 35.1 a 1,1 0 0 1 1,1 v 19.236 a 1,1 0 0 1 -1,1 H 34.128 V 32 c 0,0.761 -0.9,1.365 -1.972,1.365 z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</clipPath>
<linearGradient
id="linear-gradient"
x1="16.378942"
y1="29.809677"
x2="16.378942"
y2="34.264748"
gradientUnits="userSpaceOnUse"
gradientTransform="scale(0.98165674,1.018686)">
<stop
offset="0"
stop-color="#a8a9a8"
id="stop4526" />
<stop
offset="1"
stop-color="#545554"
id="stop4528" />
</linearGradient>
<filter
id="Path_1"
x="1826.363"
y="6180.6641"
width="38.157001"
height="39.370998"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset4531" />
<feGaussianBlur
stdDeviation="1"
result="blur"
id="feGaussianBlur4533" />
<feFlood
flood-opacity="0.502"
id="feFlood4535" />
<feComposite
operator="in"
in2="blur"
id="feComposite4537"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite4539" />
</filter>
<linearGradient
id="linear-gradient-2"
x1="0.949"
y1="0.5"
x2="0.056000002"
y2="0.5"
gradientUnits="objectBoundingBox">
<stop
offset="0"
stop-color="#b72b1c"
id="stop4542" />
<stop
offset="1"
stop-color="#8b1104"
id="stop4544" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-2"
id="linearGradient5121"
gradientUnits="userSpaceOnUse"
x1="7.315846"
y1="3.8545027"
x2="0.43170431"
y2="3.8545027"
gradientTransform="scale(1.2395892,0.80671886)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-2"
id="linearGradient5123"
gradientUnits="userSpaceOnUse"
x1="7.315846"
y1="3.8545027"
x2="0.43170431"
y2="3.8545027"
gradientTransform="scale(1.2395892,0.80671886)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-2"
id="linearGradient5125"
gradientUnits="userSpaceOnUse"
x1="7.315846"
y1="3.8545027"
x2="0.43170431"
y2="3.8545027"
gradientTransform="scale(1.2395892,0.80671886)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-2"
id="linearGradient5127"
gradientUnits="userSpaceOnUse"
x1="7.315846"
y1="3.8545027"
x2="0.43170431"
y2="3.8545027"
gradientTransform="scale(1.2395892,0.80671886)" />
</defs>
<g
id="Touch_sensor"
data-name="Touch sensor"
transform="translate(1346,5555.3655)">
<g
id="Group_8"
data-name="Group 8"
transform="translate(481.391,629.664)">
<g
id="Mask_Group_3"
data-name="Mask Group 3"
class="cls-2"
clip-path="url(#clip-path)">
<g
id="Group_2"
data-name="Group 2">
<path
id="Path_27"
data-name="Path 27"
class="cls-1"
d="M 0.758,0 H 35.342 A 0.758,0.758 0 0 1 36.1,0.758 v 19.719 a 0.758,0.758 0 0 1 -0.758,0.758 H 0.758 A 0.758,0.758 0 0 1 0,20.477 V 0.758 A 0.758,0.758 0 0 1 0.758,0 Z"
transform="translate(0,6.371)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
<g
class="cls-8"
transform="translate(-1827.39,-6183.66)"
id="g4551"
style="filter:url(#Path_1)">
<path
id="Path_1-2"
data-name="Path 1"
class="cls-3"
d="m 1.972,0 h 10.77 v 1.365 h 6.371 V 0 h 11.072 c 1.069,0 1.972,0.6 1.972,1.365 v 30.64 c 0,0.761 -0.9,1.365 -1.972,1.365 H 1.972 C 0.9,33.371 0,32.766 0,32.005 V 1.365 C 0,0.6 0.9,0 1.972,0 Z"
transform="translate(1829.36,6183.66)"
inkscape:connector-curvature="0"
style="fill:url(#linear-gradient)" />
</g>
<rect
id="Rectangle_2"
data-name="Rectangle 2"
width="0.75800002"
height="6.0669999"
transform="translate(34.584,9.404)"
x="0"
y="0" />
<rect
id="Rectangle_5"
data-name="Rectangle 5"
width="0.75800002"
height="6.0669999"
transform="translate(0.91,9.404)"
x="0"
y="0" />
<rect
id="Rectangle_3"
data-name="Rectangle 3"
width="0.75800002"
height="6.0669999"
transform="translate(34.584,18.05)"
x="0"
y="0" />
<rect
id="Rectangle_4"
data-name="Rectangle 4"
width="0.75800002"
height="6.0669999"
transform="translate(0.91,18.05)"
x="0"
y="0" />
</g>
</g>
</g>
<g
id="Group_5"
data-name="Group 5"
transform="translate(485.942,633.835)">
<rect
id="Rectangle_6"
data-name="Rectangle 6"
class="cls-4"
width="9.5559998"
height="6.2189999"
transform="translate(0,10.542)"
x="0"
y="0"
style="fill:url(#linearGradient5121)" />
<rect
id="Rectangle_9"
data-name="Rectangle 9"
class="cls-4"
width="9.5559998"
height="6.2189999"
transform="rotate(90,8.3045,8.3045)"
x="0"
y="0"
style="fill:url(#linearGradient5123)" />
<rect
id="Rectangle_7"
data-name="Rectangle 7"
class="cls-4"
width="9.5559998"
height="6.2189999"
transform="rotate(180,13.5,8.3805)"
x="0"
y="0"
style="fill:url(#linearGradient5125)" />
<rect
id="Rectangle_8"
data-name="Rectangle 8"
class="cls-4"
width="9.5559998"
height="6.2189999"
transform="rotate(-90,18.695,8.305)"
x="0"
y="0"
style="fill:url(#linearGradient5127)" />
<g
id="Ellipse_1"
data-name="Ellipse 1"
class="cls-5"
transform="translate(7.433,7.508)"
style="fill:#b72b1c;stroke:#8b1104;stroke-width:0.25px">
<circle
class="cls-6"
cx="6.0669999"
cy="6.0669999"
id="ellipse4564"
r="6.0669999"
style="stroke:none" />
<circle
class="cls-7"
cx="6.0669999"
cy="6.0669999"
id="ellipse4566"
r="5.9419999"
style="fill:none" />
</g>
<path
id="Hole"
d="m 5606.165,962.241 c 0,0 -0.048,0.917 -0.69,0.925 -0.642,0.008 -1.312,0 -1.312,0 a 2.123,2.123 0 0 0 -0.409,1.52 c 0,1.138 0.321,1.442 0.321,1.442 h 1.463 a 0.58,0.58 0 0 1 0.628,0.628 v 1.5 a 3.487,3.487 0 0 0 1.586,0.258 5.8,5.8 0 0 0 1.507,-0.258 v -1.5 a 0.655,0.655 0 0 1 0.66,-0.628 9.594,9.594 0 0 0 1.3,-0.126 c 0,0 0.356,-0.336 0.39,-1.467 0.034,-1.131 -0.317,-1.477 -0.317,-1.477 h -1.522 a 0.576,0.576 0 0 1 -0.685,-0.609 10.168,10.168 0 0 1 0,-1.476 4.326,4.326 0 0 0 -2.917,0 c -0.019,0.627 0,1.268 0,1.268 z"
transform="translate(-5594.196,-951.087)"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="256.68237mm"
height="256.68237mm"
viewBox="0 0 256.68237 256.68237"
version="1.1"
id="svg8853"
inkscape:version="0.92.1 r15371"
sodipodi:docname="brickbuttons.svg"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\brickButtons-icon.png"
inkscape:export-xdpi="11.874598"
inkscape:export-ydpi="11.874598">
<defs
id="defs8847">
<linearGradient
id="linear-gradient-4"
x1="28.287067"
y1="53.631462"
x2="28.287067"
y2="3.3378232"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.5371664,0,0,3.3819467,4.7045157,7.0563355)">
<stop
offset="0"
stop-color="#6a6a6a"
id="stop8176" />
<stop
offset="0.522"
stop-color="#8ce300"
id="stop8178" />
<stop
offset="1"
stop-color="#6a6a6a"
id="stop8180" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-82.030812"
inkscape:cy="187.27864"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1600"
inkscape:window-height="837"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata8850">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-4.695057,58.29823)">
<g
id="g9431"
transform="translate(3.9780427e-6,-32.677281)">
<path
style="fill:#6a6a6a;stroke-width:3.91719985"
inkscape:connector-curvature="0"
d="M 106.30882,198.38022 C 84.431262,177.26258 50.453467,142.52878 50.453467,142.52878 v -7.12931 H 37.087971 a 32.381533,32.381533 0 1 1 0,-64.763062 H 50.457376 V 63.503186 L 105.71341,7.0563355 h 55.25994 c 25.02699,25.5048885 55.25994,55.2599395 55.25994,55.2599395 v 8.320133 h 12.77398 a 32.381533,32.381533 0 0 1 0,64.763062 h -12.77398 v 7.13323 c -29.43384,30.27603 -54.66454,55.85144 -54.66454,55.85144 z"
class="cls-7"
data-name="Union 4"
id="Union_4" />
<path
inkscape:connector-curvature="0"
style="fill:url(#linear-gradient-4);stroke-width:3.91719985"
d="M 106.30882,198.38022 C 84.431262,177.26258 50.453467,142.52878 50.453467,142.52878 v -7.12931 H 37.087971 a 32.381533,32.381533 0 1 1 0,-64.763062 H 50.457376 V 63.503186 L 105.71731,7.0563355 h 55.25604 c 25.02699,25.5048885 55.25994,55.2599395 55.25994,55.2599395 v 8.320133 h 12.77398 a 32.381533,32.381533 0 0 1 0,64.763062 h -12.77398 v 7.13323 c -29.43384,30.27603 -54.66454,55.85144 -54.66454,55.85144 z"
class="cls-8"
id="light" />
<path
style="fill:#a8a9a8;stroke-width:3.91719985"
inkscape:connector-curvature="0"
d="m 36.492567,78.357208 h 40.69971 V 126.48393 H 36.492567 A 24.063359,24.063359 0 0 1 12.429199,102.42057 v 0 A 24.063359,24.063359 0 0 1 36.492567,78.357208 Z"
class="cls-9"
data-name="Rectangle 23"
id="Rectangle_23" />
<path
style="fill:#a8a9a8;stroke-width:3.91719985"
inkscape:connector-curvature="0"
d="M 229.00727,126.48784 H 188.30756 V 78.361126 h 40.69971 a 24.063359,24.063359 0 0 1 24.06335,24.063354 v 0 a 24.063359,24.063359 0 0 1 -24.06335,24.06336 z"
class="cls-9"
data-name="Rectangle 24"
id="Rectangle_24" />
<path
style="fill:#3c3c3c;stroke-width:3.91719985"
inkscape:connector-curvature="0"
d="m 109.27806,78.357208 h 46.9398 a 1.782326,1.782326 0 0 1 1.78233,1.782326 V 124.7016 a 1.782326,1.782326 0 0 1 -1.78233,1.78233 h -46.9398 a 1.782326,1.782326 0 0 1 -1.78233,-1.78233 V 80.139534 a 1.782326,1.782326 0 0 1 1.78233,-1.782326 z"
class="cls-4"
data-name="Path 42"
id="Path_42" />
<path
style="fill:#a8a9a8;stroke-width:3.91719985"
inkscape:connector-curvature="0"
d="m 108.09114,15.967966 49.90905,-0.59542 37.43276,38.619675 -15.44943,15.449437 V 97.367379 H 165.7249 V 81.306861 A 11.978797,11.978797 0 0 0 153.84012,69.422075 c -11.59883,-0.184102 -43.37516,0 -43.37516,0 A 9.6676495,9.6676495 0 0 0 100.36251,79.520618 V 97.347793 H 86.103905 V 69.422075 L 70.654464,53.97264 Z"
class="cls-9"
data-name="Path 15"
id="Path_15" />
<path
style="fill:#a8a9a8;stroke-width:3.91719985"
inkscape:connector-curvature="0"
d="M 157.78865,189.01028 108.18908,189.38233 70.654464,150.794 86.323259,135.4895 v -28.08625 h 14.101921 v 16.11144 a 12.006218,12.006218 0 0 0 11.85346,11.9788 c 11.59882,0.1841 43.13227,0 43.13227,0 a 10.18472,10.18472 0 0 0 10.38059,-10.38058 v -17.70966 h 14.39179 v 28.08632 l 15.3045,15.3045 z"
class="cls-9"
data-name="Path 16"
id="Path_16-2" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,308 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="2030.391 6170.607 60.976999 60.977"
version="1.1"
id="svg5788"
sodipodi:docname="gyro.svg"
width="60.977001"
height="60.977001"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\gyroSensor-icon.png"
inkscape:export-xdpi="188.92369"
inkscape:export-ydpi="188.92369"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata5792">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1137"
id="namedview5790"
showgrid="false"
inkscape:zoom="3.8703117"
inkscape:cx="17.974501"
inkscape:cy="30.488501"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg5788" />
<defs
id="defs5764">
<style
id="style5739">
.cls-1 {
fill: #a8a9a8;
}
.cls-2 {
clip-path: url(#clip-path);
}
.cls-3, .cls-9 {
fill: #9a9a9a;
}
.cls-4 {
fill: #f2f2f2;
}
.cls-5 {
opacity: 0.6;
fill: url(#linear-gradient);
}
.cls-6 {
fill: url(#linear-gradient-2);
}
.cls-7 {
fill: #b72b1c;
}
.cls-8, .cls-9 {
stroke: none;
}
.cls-10 {
filter: url(#Path_12);
}
</style>
<clipPath
id="clip-path">
<path
id="Union_7"
data-name="Union 7"
class="cls-1"
d="M 9.708,60.977 A 9.336,9.336 0 0 1 7.725,60.522 H 3.489 A 1.972,1.972 0 0 1 1.517,58.55 V 54 H 0.758 A 0.758,0.758 0 0 1 0,53.241 V 6.978 A 0.758,0.758 0 0 1 0.758,6.219 H 1.517 V 1.972 A 1.972,1.972 0 0 1 3.489,0 h 12.654 v 0.607 h 3.42 V 0 h 12.746 a 1.972,1.972 0 0 1 1.972,1.972 v 4.247 h 0.91 a 0.759,0.759 0 0 1 0.759,0.759 v 46.263 a 0.758,0.758 0 0 1 -0.759,0.758 h -0.91 v 4.551 a 1.972,1.972 0 0 1 -1.972,1.972 h -4.141 c -0.17,0.3 -1.911,0.455 -2.229,0.455 z"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</clipPath>
<filter
id="Path_12"
x="2030.408"
y="6169.1069"
width="35.764"
height="50.779999"
filterUnits="userSpaceOnUse">
<feOffset
input="SourceAlpha"
id="feOffset5743" />
<feGaussianBlur
stdDeviation="0.5"
result="blur"
id="feGaussianBlur5745" />
<feFlood
flood-opacity="0.502"
id="feFlood5747" />
<feComposite
operator="in"
in2="blur"
id="feComposite5749"
result="result1" />
<feComposite
in="SourceGraphic"
in2="result1"
id="feComposite5751" />
</filter>
<linearGradient
id="linear-gradient"
x1="6.4034481"
x2="6.4034481"
y2="12.806896"
gradientUnits="userSpaceOnUse"
gradientTransform="scale(2.5583092,0.39088316)"
y1="0">
<stop
offset="0"
stop-color="#fff"
stop-opacity="0"
id="stop5754" />
<stop
offset="1"
stop-color="#404040"
id="stop5756" />
</linearGradient>
<linearGradient
id="linear-gradient-2"
x1="0.5"
x2="0.5"
y2="1"
gradientUnits="objectBoundingBox">
<stop
offset="0"
stop-color="#fff"
id="stop5759" />
<stop
offset="1"
stop-color="gray"
id="stop5761" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-2"
id="linearGradient6337"
gradientUnits="userSpaceOnUse"
x1="-0.54480195"
x2="-0.54480195"
y2="6.8587804"
gradientTransform="scale(3.1897429,0.31350489)"
y1="0.39872125" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-2"
id="linearGradient6339"
gradientUnits="userSpaceOnUse"
x1="-0.57290149"
x2="-0.57290149"
y2="6.9009762"
gradientTransform="scale(3.0330478,0.32970136)"
y1="3.2110665e-006" />
</defs>
<g
id="gyro"
transform="translate(1358.514,5554.0004)">
<g
id="Group_16"
data-name="Group 16"
transform="translate(684.391,616.607)">
<g
id="Mask_Group_7"
data-name="Mask Group 7"
class="cls-2"
clip-path="url(#clip-path)">
<g
id="Group_9"
data-name="Group 9">
<path
id="Path_29"
data-name="Path 29"
class="cls-1"
d="m 0.758,0 h 34.433 a 0.758,0.758 0 0 1 0.758,0.758 V 47.022 A 0.758,0.758 0 0 1 35.191,47.78 H 0.758 A 0.758,0.758 0 0 1 0,47.022 V 0.758 A 0.758,0.758 0 0 1 0.758,0 Z"
transform="translate(0,6.219)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
<rect
id="Rectangle_11"
data-name="Rectangle 11"
class="cls-3"
width="5.7639999"
height="15.775"
transform="translate(15.017,0.607)"
x="0"
y="0"
style="fill:#9a9a9a" />
<g
class="cls-10"
transform="translate(-2030.39,-6170.61)"
id="g5769"
style="filter:url(#Path_12)">
<path
id="Path_12-2"
data-name="Path 12"
class="cls-1"
d="m 1.972,0 h 12.655 v 16.015 l 3.42,-0.251 V 0 h 12.745 a 1.972,1.972 0 0 1 1.972,1.972 v 43.837 a 1.972,1.972 0 0 1 -1.972,1.972 H 1.972 A 1.972,1.972 0 0 1 0,45.809 V 1.972 A 1.972,1.972 0 0 1 1.972,0 Z"
transform="translate(2031.91,6170.61)"
inkscape:connector-curvature="0"
style="fill:#a8a9a8" />
</g>
<g
id="hvid"
transform="translate(1.517,29.578)">
<g
id="hvid-2"
data-name="hvid">
<path
id="Path_57"
data-name="Path 57"
class="cls-4"
d="M 1.213,0 H 31.55 a 1.213,1.213 0 0 1 1.213,1.213 v 27.759 a 1.972,1.972 0 0 1 -1.972,1.972 H 1.972 A 1.972,1.972 0 0 1 0,28.972 V 1.213 A 1.213,1.213 0 0 1 1.213,0 Z"
inkscape:connector-curvature="0"
style="fill:#f2f2f2" />
<path
id="Path_59"
data-name="Path 59"
class="cls-5"
d="M 0,0 H 32.764 V 3.034 A 1.972,1.972 0 0 1 30.792,5.006 H 1.972 A 1.972,1.972 0 0 1 0,3.034 Z"
transform="translate(0,25.938)"
inkscape:connector-curvature="0"
style="opacity:0.6;fill:url(#linear-gradient)" />
</g>
<g
id="Path_1"
data-name="Path 1"
class="cls-6"
transform="translate(17.936,29.123)"
style="fill:url(#linearGradient6339)">
<path
class="cls-8"
d="M 6.4848423,2.1502612 H -9.7453671 c -0.1358308,0 -0.6785509,-0.09074 -1.2538699,-0.2385202 -0.648927,-0.1666809 -0.94169,-0.3052633 -1.041505,-0.3812874 l 1.249305,-1.03739253 c 0.303109,-0.25294002 0.75468,-0.36806001 1.0460699,-0.36806001 H 6.4848423 c 0.2201104,0 0.3956304,0.15657998 0.5988703,0.33788 0.052504,0.0468377 0.106761,0.0952419 0.1628327,0.14147469 L 8.5651855,1.7936107 C 8.487011,1.8440639 8.2630816,1.9419193 7.6369224,2.0377111 7.1470423,2.1126511 6.6342626,2.1502612 6.4848423,2.1502612 Z"
id="path5774"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient6337);stroke:none" />
<path
class="cls-9"
d="m 6.4848423,2.0252612 c 0.3687601,0 1.4223461,-0.1225882 1.8561678,-0.2655033 L 7.1648941,0.69904226 C 7.1077342,0.65182292 7.0532455,0.6032095 7.0005026,0.55616105 6.8163424,0.39188105 6.6573024,0.25000107 6.4848423,0.25000107 H -9.7453671 c -0.2695699,0 -0.6867699,0.10602999 -0.9662209,0.33921999 l -1.113573,0.92468484 c 0.473236,0.2207455 1.776214,0.5113553 2.0797939,0.5113553 H 6.4848423 m 0,0.25 H -9.7453671 c -0.3350909,0 -2.4577609,-0.4373601 -2.4577609,-0.7724501 l 1.33183,-1.10592004 c 0.31863,-0.26589 0.79084,-0.396890001307 1.1259309,-0.396890001307 H 6.4848423 c 0.3350902,0 0.5700002,0.284719991307 0.8433003,0.509620021307 L 8.7278528,1.771991 c 0,0.3350902 -1.9079203,0.5032702 -2.2430105,0.5032702 z"
id="path5776"
inkscape:connector-curvature="0"
style="fill:#9a9a9a;stroke:none" />
</g>
</g>
<g
id="red_things"
data-name="red things"
transform="translate(4.551,8.494)">
<circle
id="red_dot"
data-name="red dot"
class="cls-7"
cx="3.0339999"
cy="3.0339999"
transform="translate(10.315,5.916)"
r="3.0339999"
style="fill:#b72b1c" />
<path
id="red_arrow_1"
data-name="red arrow 1"
class="cls-7"
d="m 3122.963,-1932.135 c 0,0 -3.9,-5.13 -0.759,-10.77 0.232,0.143 0.682,0.347 0.91,0.455 0.645,0.367 0.74,-0.309 0.607,-0.758 -0.3,-0.948 -1.214,-3.792 -1.214,-3.792 l -3.792,1.062 a 1.446,1.446 0 0 0 -0.455,0.152 c -0.2,0.125 -0.369,0.4 0,0.607 l 1.062,0.607 c 0,0 -4.526,6.652 1.062,14.258 1.598,-1.14 2.579,-1.821 2.579,-1.821 z"
transform="translate(-3117.592,1947)"
inkscape:connector-curvature="0"
style="fill:#b72b1c" />
<path
id="red_arrow_2"
data-name="red arrow 2"
class="cls-7"
d="m 3118.4,-1932.135 c 0,0 3.9,-5.13 0.758,-10.77 -0.231,0.143 -0.681,0.347 -0.91,0.455 -0.645,0.367 -0.741,-0.309 -0.607,-0.758 0.3,-0.948 1.213,-3.792 1.213,-3.792 l 3.792,1.062 a 1.446,1.446 0 0 1 0.455,0.152 c 0.2,0.125 0.368,0.4 0,0.607 l -1.062,0.607 c 0,0 4.526,6.652 -1.062,14.258 -1.594,-1.14 -2.577,-1.821 -2.577,-1.821 z"
transform="translate(-3097.107,1947)"
inkscape:connector-curvature="0"
style="fill:#b72b1c" />
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="1447.52 6142.536 58.928002 58.928"
version="1.1"
id="svg6348"
sodipodi:docname="icn_port.svg"
width="58.928001"
height="58.928001"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\portB.png"
inkscape:export-xdpi="156.39424"
inkscape:export-ydpi="156.39424"
inkscape:version="0.92.1 r15371">
<metadata
id="metadata6352">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="837"
id="namedview6350"
showgrid="false"
inkscape:zoom="4.0048872"
inkscape:cx="24.98"
inkscape:cy="29.464001"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6348" />
<defs
id="defs6343">
<style
id="style6341">
.cls-1 {
fill: #eaeaea;
}
.cls-2 {
fill: #a8a9a8;
}
</style>
</defs>
<path
style="fill:#eaeaea;stroke-width:1.08854139"
inkscape:connector-curvature="0"
d="m 1447.5095,6142.536 h 59.1987 v 58.928 h -59.1987 z"
class="cls-1"
data-name="Path 8"
id="Path_8" />
<path
style="fill:#a8a9a8"
inkscape:connector-curvature="0"
d="M 1457.257,6189.022 V 6161.2 h 17.114 v -6.912 h 4.716 v -9.159 h 12.923 v 8.814 h 5.064 v 35.08 h -8.033 v 7.43 h -2.62 v -7.51 h -1.985 v 7.507 h -2.206 v -7.507 h -2.16 v 7.507 h -2.1 v -7.507 h -1.852 v 7.507 h -2.1 v -7.507 h -1.819 v 7.507 h -2.464 v -7.507 h -1.678 v 7.507 h -2.518 v -7.457 z"
class="cls-2"
data-name="Path 9"
id="Path_9" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:1.25;font-family:consolas;-inkscape-font-specification:consolas;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
x="1475.2291"
y="6185.2339"
id="text10060"><tspan
sodipodi:role="line"
id="tspan10058"
x="1475.2291"
y="6185.2339">B</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="26.48797mm"
height="26.48797mm"
viewBox="0 0 26.48797 26.487971"
version="1.1"
id="svg9467"
inkscape:version="0.92.1 r15371"
sodipodi:docname="screen.svg">
<defs
id="defs9461">
<linearGradient
id="linear-gradient-5"
x1="2.1718912"
y1="1.576793"
x2="2.1718912"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.18480341,0,0,0.37880435,268.75789,80.522339)"
y2="0">
<stop
offset="0"
stop-color="#747474"
id="stop8183" />
<stop
offset="1"
stop-color="#3c3c3c"
id="stop8185" />
</linearGradient>
<linearGradient
id="linear-gradient-2"
x1="44.516197"
y1="82.265938"
x2="44.516197"
y2="84.402718"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.2975093,0,0,0.23530135,255.87506,61.218339)">
<stop
offset="0"
stop-color="#a8a9a8"
id="stop8166" />
<stop
offset="1"
stop-color="gray"
id="stop8168" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="1.3096574"
inkscape:cy="-1.004129"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1137"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata9464">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-255.87506,-58.769882)">
<g
id="g10052"
transform="translate(1.7608642e-7,-1.2242278)"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<path
inkscape:connector-curvature="0"
style="fill:url(#linear-gradient-2);stroke-width:0.26458332"
d="m 256.39682,61.218339 h 25.44445 a 0.52175833,0.52175833 0 0 1 0.52176,0.521759 v 19.905926 a 0.52175833,0.52175833 0 0 1 -0.52176,0.521759 h -25.44445 a 0.52175833,0.52175833 0 0 1 -0.52176,-0.521759 V 61.740098 a 0.52175833,0.52175833 0 0 1 0.52176,-0.521759 z"
class="cls-3"
data-name="Path 18"
id="Path_18" />
<path
style="fill:#3c3c3c;stroke-width:0.26458332"
inkscape:connector-curvature="0"
d="m 259.28634,63.987468 h 19.70537 a 1.0033,1.0033 0 0 1 1.0033,1.0033 v 11.076781 a 1.0033,1.0033 0 0 1 -1.0033,1.0033 h -19.70537 a 1.0033,1.0033 0 0 1 -1.0033,-1.0033 V 64.990768 a 1.0033,1.0033 0 0 1 1.0033,-1.0033 z"
class="cls-4"
data-name="Path 17"
id="Path_17" />
<path
style="fill:#a0b5a6;stroke-width:0.26458332"
inkscape:connector-curvature="0"
d="m 260.8114,64.509227 h 16.73569 a 0.7223125,0.7223125 0 0 1 0.72231,0.722312 v 10.675408 a 0.7223125,0.7223125 0 0 1 -0.72231,0.722313 H 260.8114 a 0.7223125,0.7223125 0 0 1 -0.72232,-0.722313 V 65.231539 a 0.7223125,0.7223125 0 0 1 0.72232,-0.722312 z"
class="cls-5"
data-name="Path 16"
id="Path_16" />
<rect
style="fill:#3c3c3c;stroke-width:0.26458332"
y="77.030579"
x="268.7579"
height="3.6520438"
width="0.80274582"
class="cls-4"
data-name="Rectangle 26"
id="Rectangle_26" />
<rect
style="fill:#9a9a9a;stroke-width:0.26458332"
y="80.522354"
x="268.7579"
height="1.6052271"
width="0.80274582"
class="cls-10"
data-name="Rectangle 10"
id="Rectangle_10" />
<rect
y="80.522354"
x="268.7579"
style="fill:url(#linear-gradient-5);stroke-width:0.26458332"
height="1.6454437"
width="0.80274582"
class="cls-11"
data-name="Rectangle 12"
id="Rectangle_12" />
<rect
style="fill:#808080;stroke-width:0.26458332"
y="82.167732"
x="268.7579"
height="1.565275"
width="0.80274582"
class="cls-12"
data-name="Rectangle 11"
id="Rectangle_11" />
<path
style="fill:#a8a9a8;stroke-width:0.26458332"
inkscape:connector-curvature="0"
d="m 257.9621,82.167783 h 6.26083 v 1.511829 c -0.69268,0.697971 -1.58115,1.578239 -1.58115,1.578239 h -4.15792 a 0.52175833,0.52175833 0 0 1 -0.52176,-0.521493 z"
class="cls-9"
data-name="Path 15"
id="Path_15-2" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2186 6829.289 63 68.355">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="trash" transform="translate(49 672)">
<path id="Subtraction_2" data-name="Subtraction 2" class="cls-1" d="M-.5-603.645H-34a9.01,9.01,0,0,1-9-9v-42h-4a2,2,0,0,1-2-2v-2a2,2,0,0,1,2-2h12.82l3.919-7.542a5.256,5.256,0,0,1,1.332-1.9,7.7,7.7,0,0,1,5.481-1.9H-10.78s.083-.005.226-.005a8.02,8.02,0,0,1,2.9.565,5.812,5.812,0,0,1,3.3,3.249c1.682,4.051,3.219,7.508,3.235,7.542H12a2,2,0,0,1,2,2v2a2,2,0,0,1-2,2H8.5v42A9.01,9.01,0,0,1-.5-603.645Zm-7-46a1.5,1.5,0,0,0-1.5,1.5v32a1.5,1.5,0,0,0,1.5,1.5h3a1.5,1.5,0,0,0,1.5-1.5v-32a1.5,1.5,0,0,0-1.5-1.5Zm-11.5,0a1.5,1.5,0,0,0-1.5,1.5v32a1.5,1.5,0,0,0,1.5,1.5h3a1.5,1.5,0,0,0,1.5-1.5v-32a1.5,1.5,0,0,0-1.5-1.5Zm-11.5,0a1.5,1.5,0,0,0-1.5,1.5v32a1.5,1.5,0,0,0,1.5,1.5h3a1.5,1.5,0,0,0,1.5-1.5v-32a1.5,1.5,0,0,0-1.5-1.5Zm5.845-16.571-3.245,5.571H-7.517l-2.437-5.571Z" transform="translate(-2186 6829.29)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,535 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="2330.575 6196.231 83.275 83.274999"
version="1.1"
id="svg5190"
sodipodi:docname="ultra sonic.svg"
width="83.275002"
height="83.275002"
inkscape:version="0.92.1 r15371"
inkscape:export-filename="C:\gh\pxt-ev3\libs\core\jres\icons\ultrasonicSensor-icon.png"
inkscape:export-xdpi="138.33684"
inkscape:export-ydpi="138.33684">
<metadata
id="metadata5194">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1137"
id="namedview5192"
showgrid="false"
inkscape:zoom="3.4103872"
inkscape:cx="41.637501"
inkscape:cy="17.443501"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg5190" />
<defs
id="defs5133">
<style
id="style5129">
.cls-1 {
fill: #f2f2f2;
}
.cls-2 {
fill: #292929;
}
.cls-3 {
stroke: rgba(242,242,242,0.5);
stroke-width: 0.25px;
}
.cls-4 {
fill: #931f1f;
}
.cls-5 {
fill: #9d761f;
}
.cls-6 {
clip-path: url(#clip-path);
}
.cls-7 {
stroke: none;
}
.cls-8 {
fill: none;
}
</style>
<clipPath
id="clip-path">
<circle
id="guld"
class="cls-1"
cx="6.9770002"
cy="6.9770002"
r="6.9770002"
style="fill:#f2f2f2" />
</clipPath>
</defs>
<g
id="ultra_sonic"
data-name="ultra sonic"
transform="translate(1222,5578.1935)">
<rect
id="Rectangle_1"
data-name="Rectangle 1"
class="cls-2"
width="43.382"
height="31.247"
transform="translate(1131.024,643.596)"
x="0"
y="0"
style="fill:#292929" />
<rect
id="Rectangle_2"
data-name="Rectangle 2"
width="25.330999"
height="17.594999"
transform="translate(1138.609,650.573)"
x="0"
y="0" />
<g
id="eye1"
transform="translate(1108.575,642.231)">
<g
id="sort"
class="cls-3"
style="stroke-width:0.25px">
<circle
class="cls-7"
cx="17.444"
cy="17.444"
id="ellipse5137"
r="17.444"
style="stroke:none" />
<circle
class="cls-8"
cx="17.444"
cy="17.444"
id="ellipse5139"
r="17.319"
style="fill:none" />
</g>
<circle
id="rød"
class="cls-4"
cx="10.77"
cy="10.77"
transform="translate(6.674,6.674)"
r="10.77"
style="fill:#931f1f" />
<circle
id="guld-3"
data-name="guld"
class="cls-5"
cx="8.0389996"
cy="8.0389996"
transform="translate(9.404,9.404)"
r="8.0389996"
style="fill:#9d761f" />
<circle
id="guld-4"
data-name="guld"
class="cls-1"
cx="6.9770002"
cy="6.9770002"
transform="translate(10.466,10.466)"
r="6.9770002"
style="fill:#f2f2f2" />
<g
id="Group_5"
data-name="Group 5"
transform="translate(10.466,10.466)">
<g
id="Mask_Group_8"
data-name="Mask Group 8"
class="cls-6"
clip-path="url(#clip-path)">
<g
id="Group_17"
data-name="Group 17"
transform="rotate(-30,2.4159415,14.94335)">
<rect
id="Rectangle_84"
data-name="Rectangle 84"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(2.048)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_91"
data-name="Rectangle 91"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,10.049,10.049)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_85"
data-name="Rectangle 85"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(4.93)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_97"
data-name="Rectangle 97"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,8.608,8.608)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_86"
data-name="Rectangle 86"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(7.812)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_96"
data-name="Rectangle 96"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,7.167,7.167)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_87"
data-name="Rectangle 87"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(10.694)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_95"
data-name="Rectangle 95"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,5.726,5.726)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_88"
data-name="Rectangle 88"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(13.576)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_94"
data-name="Rectangle 94"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,4.285,4.285)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_89"
data-name="Rectangle 89"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(16.458)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_93"
data-name="Rectangle 93"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,2.844,2.844)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_90"
data-name="Rectangle 90"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(19.34)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_92"
data-name="Rectangle 92"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,1.403,1.403)"
x="0"
y="0"
style="fill:#9d761f" />
</g>
</g>
</g>
</g>
<g
id="eye2"
transform="translate(1156.962,642.231)">
<g
id="sort-2"
data-name="sort"
class="cls-3"
style="stroke-width:0.25px">
<circle
class="cls-7"
cx="17.444"
cy="17.444"
id="ellipse5163"
r="17.444"
style="stroke:none" />
<circle
class="cls-8"
cx="17.444"
cy="17.444"
id="ellipse5165"
r="17.319"
style="fill:none" />
</g>
<circle
id="rød-2"
data-name="rød"
class="cls-4"
cx="10.77"
cy="10.77"
transform="translate(6.674,6.674)"
r="10.77"
style="fill:#931f1f" />
<circle
id="guld-5"
data-name="guld"
class="cls-5"
cx="8.0389996"
cy="8.0389996"
transform="translate(9.404,9.404)"
r="8.0389996"
style="fill:#9d761f" />
<circle
id="guld-6"
data-name="guld"
class="cls-1"
cx="6.9770002"
cy="6.9770002"
transform="translate(10.466,10.466)"
r="6.9770002"
style="fill:#f2f2f2" />
<g
id="Group_18"
data-name="Group 18"
transform="translate(10.466,10.466)">
<g
id="Mask_Group_8-2"
data-name="Mask Group 8"
class="cls-6"
clip-path="url(#clip-path)">
<g
id="Group_17-2"
data-name="Group 17"
transform="rotate(-30,2.4159415,14.94335)">
<rect
id="Rectangle_84-2"
data-name="Rectangle 84"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(2.048)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_91-2"
data-name="Rectangle 91"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,10.049,10.049)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_85-2"
data-name="Rectangle 85"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(4.93)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_97-2"
data-name="Rectangle 97"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,8.608,8.608)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_86-2"
data-name="Rectangle 86"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(7.812)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_96-2"
data-name="Rectangle 96"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,7.167,7.167)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_87-2"
data-name="Rectangle 87"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(10.694)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_95-2"
data-name="Rectangle 95"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,5.726,5.726)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_88-2"
data-name="Rectangle 88"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(13.576)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_94-2"
data-name="Rectangle 94"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,4.285,4.285)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_89-2"
data-name="Rectangle 89"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(16.458)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_93-2"
data-name="Rectangle 93"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,2.844,2.844)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_90-2"
data-name="Rectangle 90"
class="cls-5"
width="0.60699999"
height="22.791"
transform="translate(19.34)"
x="0"
y="0"
style="fill:#9d761f" />
<rect
id="Rectangle_92-2"
data-name="Rectangle 92"
class="cls-5"
width="0.60699999"
height="22.507"
transform="rotate(-90,1.403,1.403)"
x="0"
y="0"
style="fill:#9d761f" />
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,36 +1,52 @@
{
"Array": "Add, remove, and replace items in lists.\n\nAdd, remove, and replace items in lists.",
"Array.filter": "Returns the elements of an array that meet the condition specified in a callback function.",
"Array.filter": "Return the elements of an array that meet the condition specified in a callback function.",
"Array.filter|param|callbackfn": "A function that accepts up to two arguments. The filter method calls the callbackfn function one time for each element in the array.",
"Array.get": "Gets the value at a particular index",
"Array.get": "Get the value at a particular index",
"Array.get|param|index": "the zero-based position in the list of the item, eg: 0",
"Array.indexOf": "Returns the index of the first occurrence of a value in an array.",
"Array.indexOf": "Return the index of the first occurrence of a value in an array.",
"Array.indexOf|param|fromIndex": "The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.",
"Array.indexOf|param|item": "The value to locate in the array.",
"Array.insertAt": "Insert the value at a particular index, increases length by 1",
"Array.insertAt|param|index": "the zero-based position in the list to insert the value, eg: 0",
"Array.length": "Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.",
"Array.map": "Calls a defined callback function on each element of an array, and returns an array that contains the results.",
"Array.length": "Get or set the length of an array. This number is one more than the index of the last element the array.",
"Array.map": "Call a defined callback function on each element of an array, and return an array containing the results.",
"Array.map|param|callbackfn": "A function that accepts up to two arguments. The map method calls the callbackfn function one time for each element in the array.",
"Array.pop": "Removes the last element from an array and returns it.",
"Array.push": "Appends new elements to an array.",
"Array.reduce": "Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.",
"Array.pop": "Remove the last element from an array and return it.",
"Array.push": "Append a new element to an array.",
"Array.reduce": "Call the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.",
"Array.reduce|param|callbackfn": "A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the array.",
"Array.reduce|param|initialValue": "Initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.",
"Array.removeAt": "Removes the object at position index.",
"Array.removeElement": "Removes the first occurence of an object. Returns true if removed.",
"Array.reverse": "Reverses the elements in an Array. The first array element becomes the last, and the last array element becomes the first.",
"Array.set": "Stores the value at a particular index",
"Array.removeAt": "Remove the element at a certain index.",
"Array.removeElement": "Remove the first occurence of an object. Returns true if removed.",
"Array.reverse": "Reverse the elements in an array. The first array element becomes the last, and the last array element becomes the first.",
"Array.set": "Store a value at a particular index",
"Array.set|param|index": "the zero-based position in the list to store the value, eg: 0",
"Array.shift": "Removes the first element from an array and returns that element. This method changes the length of the array.",
"Array.slice": "Returns a section of an array.",
"Array.shift": "Remove the first element from an array and return it. This method changes the length of the array.",
"Array.slice": "Return a section of an array.",
"Array.slice|param|end": "The end of the specified portion of the array. eg: 0",
"Array.slice|param|start": "The beginning of the specified portion of the array. eg: 0",
"Array.sort": "Sorts the elements of an array in place and returns the array. The sort is not necessarily stable.",
"Array.splice": "Removes elements from an array.",
"Array.sort": "Sort the elements of an array in place and returns the array. The sort is not necessarily stable.",
"Array.splice": "Remove elements from an array.",
"Array.splice|param|deleteCount": "The number of elements to remove. eg: 0",
"Array.splice|param|start": "The zero-based location in the array from which to start removing elements. eg: 0",
"Array.unshift": "Adds one element to the beginning of an array and returns the new length of the array.",
"Array.unshift": "Add one element to the beginning of an array and return the new length of the array.",
"Boolean.toString": "Returns a string representation of an object.",
"Buffer.fill": "Fill (a fragment) of the buffer with given value.",
"Buffer.getNumber": "Read a number in specified format from the buffer.",
"Buffer.length": "Returns the length of a Buffer object.",
"Buffer.rotate": "Rotate buffer left in place.\n\n\n\nstart. eg: -1",
"Buffer.rotate|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus",
"Buffer.rotate|param|offset": "number of bytes to shift; use negative value to shift right",
"Buffer.rotate|param|start": "start offset in buffer. Default is 0.",
"Buffer.setNumber": "Write a number in specified format in the buffer.",
"Buffer.shift": "Shift buffer left in place, with zero padding.\n\n\n\nstart. eg: -1",
"Buffer.shift|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus",
"Buffer.shift|param|offset": "number of bytes to shift; use negative value to shift right",
"Buffer.shift|param|start": "start offset in buffer. Default is 0.",
"Buffer.slice": "Return a copy of a fragment of a buffer.",
"Buffer.toHex": "Convert a buffer to its hexadecimal representation.",
"Buffer.write": "Write contents of `src` at `dstOffset` in current buffer.",
"Math": "More complex operations with numbers.",
"Math.abs": "Returns the absolute value of a number (the value without regard to whether it is positive or negative).\nFor example, the absolute value of -5 is the same as the absolute value of 5.",
"Math.abs|param|x": "A numeric expression for which the absolute value is needed.",
@ -76,7 +92,7 @@
"Math.pow|param|x": "The base value of the expression.",
"Math.pow|param|y": "The exponent value of the expression.",
"Math.random": "Returns a pseudorandom number between 0 and 1.",
"Math.randomRange": "Returns a pseudorandom number between min and max included. \nIf both numbers are integral, the result is integral.",
"Math.randomRange": "Returns a pseudorandom number between min and max included.\nIf both numbers are integral, the result is integral.",
"Math.randomRange|param|max": "the upper inclusive bound, eg: 10",
"Math.randomRange|param|min": "the lower inclusive bound, eg: 0",
"Math.round": "Returns a supplied numeric expression rounded to the nearest number.",
@ -91,23 +107,26 @@
"Math.tan|param|x": "An angle in radians",
"Math.trunc": "Returns the number with the decimal part truncated.",
"Math.trunc|param|x": "A numeric expression.",
"Number.toString": "Returns a string representation of a number.",
"String": "Combine, split, and search text strings.\n\nCombine, split, and search text strings.",
"String.charAt": "Returns the character at the specified index.",
"String.charAt": "Return the character at the specified index.",
"String.charAt|param|index": "The zero-based index of the desired character.",
"String.charCodeAt": "Returns the Unicode value of the character at the specified location.",
"String.charCodeAt": "Return the Unicode value of the character at the specified location.",
"String.charCodeAt|param|index": "The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.",
"String.compare": "Determines whether relative order of two strings (in ASCII encoding).",
"String.compare": "See how the order of characters in two strings is different (in ASCII encoding).",
"String.compare|param|that": "String to compare to target string",
"String.concat": "Returns a string that contains the concatenation of two or more strings.",
"String.concat|param|other": "The string to append to the end of the string.",
"String.fromCharCode": "Make a string from the given ASCII character code.",
"String.isEmpty": "Returns a value indicating if the string is empty",
"String.length": "Returns the length of a String object.",
"String.substr": "Return substring of the current string.",
"String.substr": "Return a substring of the current string.",
"String.substr|param|length": "number of characters to extract",
"String.substr|param|start": "first character index; can be negative from counting from the end, eg:0",
"control": "Program controls and events.",
"control.assert": "Display specified error code and stop the program.",
"control.AnimationQueue.cancel": "Cancels the current running animation and clears the queue",
"control.AnimationQueue.runUntilDone": "Runs 'render' in a loop until it returns false or the 'stop' function is called",
"control.assert": "Display an error code and stop the program when the assertion is `false`.",
"control.deviceSerialNumber": "Derive a unique, consistent serial number of this device from internal data.",
"control.millis": "Gets the number of milliseconds elapsed since power on.",
"control.onEvent": "Run code when a registered event happens.",
@ -119,15 +138,20 @@
"control.waitForEvent": "Blocks the calling thread until the specified event is raised.",
"control.waitMicros": "Block the current fiber for the given microseconds",
"control.waitMicros|param|micros": "number of micro-seconds to wait. eg: 4",
"hex": "Tagged hex literal converter",
"loops.forever": "Repeats the code forever in the background. On each iteration, allows other codes to run.",
"loops.pause": "Pause for the specified time in milliseconds",
"loops.pause|param|ms": "how long to pause for, eg: 100, 200, 500, 1000, 2000",
"parseInt": "Convert a string to an integer.",
"pauseUntil": "Busy wait for a condition to be true",
"pauseUntil|param|condition": "condition to test for",
"pauseUntil|param|timeOut": "if positive, maximum duration to wait for in milliseconds",
"serial": "Reading and writing data over a serial connection.",
"serial.writeBuffer": "Send a buffer across the serial connection.",
"serial.writeLine": "Write a line of text to the serial port.",
"serial.writeNumber": "Write a number to the serial port.",
"serial.writeString": "Write some text to the serial port.",
"serial.writeValue": "Write a name:value pair as a line of text to the serial port.",
"serial.writeValue|param|name": "name of the value stream, eg: x",
"serial.writeValue|param|name": "name of the value stream, eg: \"x\"",
"serial.writeValue|param|value": "to write"
}

View File

@ -19,6 +19,7 @@
"String.length|block": "length of %VALUE",
"String.substr|block": "substring of %this=text|from %start|of length %length",
"String|block": "String",
"control.assert|block": "assert %cond|with value %code",
"control.deviceSerialNumber|block": "device serial number",
"control.millis|block": "millis (ms)",
"control.onEvent|block": "on event|from %src|with value %value",
@ -29,8 +30,9 @@
"control.waitMicros|block": "wait (µs)%micros",
"control|block": "control",
"loops.forever|block": "forever",
"loops.pause|block": "pause (ms) %pause",
"loops.pause|block": "pause %pause=timePicker|ms",
"loops|block": "loops",
"parseInt|block": "parse to integer %text",
"serial.writeBuffer|block": "serial|write buffer %buffer",
"serial.writeLine|block": "serial|write line %text",
"serial.writeNumber|block": "serial|write number %value",
@ -39,9 +41,13 @@
"serial|block": "serial",
"{id:category}Array": "Array",
"{id:category}Arrays": "Arrays",
"{id:category}Boolean": "Boolean",
"{id:category}Buffer": "Buffer",
"{id:category}Control": "Control",
"{id:category}Helpers": "Helpers",
"{id:category}Loops": "Loops",
"{id:category}Math": "Math",
"{id:category}Number": "Number",
"{id:category}Serial": "Serial",
"{id:category}String": "String",
"{id:category}Text": "Text"

17
libs/base/shims.d.ts vendored
View File

@ -70,7 +70,7 @@ declare namespace loops {
* Repeats the code forever in the background. On each iteration, allows other codes to run.
* @param body code to execute
*/
//% help=loops/forever weight=100 blockGap=8
//% help=loops/forever weight=100 afterOnStart=true
//% blockId=forever block="forever" blockAllowMultiple=1 shim=loops::forever
function forever(a: () => void): void;
@ -79,7 +79,7 @@ declare namespace loops {
* @param ms how long to pause for, eg: 100, 200, 500, 1000, 2000
*/
//% help=loops/pause weight=99
//% async block="pause (ms) %pause"
//% async block="pause %pause=timePicker|ms"
//% blockId=device_pause shim=loops::pause
function pause(ms: int32): void;
}
@ -99,8 +99,8 @@ declare namespace control {
*/
//% weight=20 blockGap=8 blockId="control_on_event" block="on event|from %src|with value %value"
//% blockExternalInputs=1
//% help="control/on-event" shim=control::onEvent
function onEvent(src: int32, value: int32, handler: () => void): void;
//% help="control/on-event" flags.defl=16 shim=control::onEvent
function onEvent(src: int32, value: int32, handler: () => void, flags?: int32): void;
/**
* Reset the device.
@ -120,7 +120,7 @@ declare namespace control {
/**
* Run other code in the background.
*/
//% help=control/run-in-background blockAllowMultiple=1
//% help=control/run-in-background blockAllowMultiple=1 afterOnStart=true
//% blockId="control_run_in_background" block="run in background" blockGap=8 shim=control::runInBackground
function runInBackground(a: () => void): void;
@ -134,7 +134,8 @@ declare namespace control {
/**
* Derive a unique, consistent serial number of this device from internal data.
*/
//% blockId="control_device_serial_number" block="device serial number" weight=9 shim=control::deviceSerialNumber
//% blockId="control_device_serial_number" block="device serial number" weight=9
//% help=control/device-serial-number shim=control::deviceSerialNumber
function deviceSerialNumber(): int32;
}
declare namespace serial {
@ -143,14 +144,14 @@ declare namespace serial {
* Write some text to the serial port.
*/
//% help=serial/write-string
//% weight=87
//% weight=87 blockHidden=true
//% blockId=serial_writestring block="serial|write string %text" shim=serial::writeString
function writeString(text: string): void;
/**
* Send a buffer across the serial connection.
*/
//% help=serial/write-buffer advanced=true weight=6
//% help=serial/write-buffer weight=6 blockHidden=true
//% blockId=serial_writebuffer block="serial|write buffer %buffer" shim=serial::writeBuffer
function writeBuffer(buffer: Buffer): void;
}

View File

@ -0,0 +1,3 @@
# Color sensor
The library to interact with the Touch Sensor.

View File

@ -0,0 +1,15 @@
{
"sensors.ColorSensor": "The color sensor is a digital sensor that can detect the color or intensity\nof light that enters the small window on the face of the sensor.",
"sensors.ColorSensor.color": "Get the current color from the color sensor.",
"sensors.ColorSensor.colorMode": "Gets the current color mode",
"sensors.ColorSensor.light": "Measures the ambient or reflected light value from 0 (darkest) to 100 (brightest).",
"sensors.ColorSensor.onColorDetected": "Registers code to run when the given color is detected.",
"sensors.ColorSensor.onColorDetected|param|color": "the color to detect, eg: ColorSensorColor.Blue",
"sensors.ColorSensor.onColorDetected|param|handler": "the code to run when detected",
"sensors.ColorSensor.onLightChanged": "Registers code to run when the ambient light changes.",
"sensors.ColorSensor.onLightChanged|param|condition": "the light condition",
"sensors.ColorSensor.onLightChanged|param|handler": "the code to run when detected",
"sensors.ColorSensor.pauseForColor": "Waits for the given color to be detected",
"sensors.ColorSensor.pauseForColor|param|color": "the color to detect",
"sensors.ColorSensor.pauseForLight": "Waits for the given color to be detected"
}

View File

@ -0,0 +1,29 @@
{
"ColorSensorColor.Black|block": "black",
"ColorSensorColor.Blue|block": "blue",
"ColorSensorColor.Brown|block": "brown",
"ColorSensorColor.Green|block": "green",
"ColorSensorColor.None|block": "none",
"ColorSensorColor.Red|block": "red",
"ColorSensorColor.White|block": "white",
"ColorSensorColor.Yellow|block": "yellow",
"ColorSensorMode.AmbientLightIntensity|block": "ambient light intensity",
"ColorSensorMode.Color|block": "color",
"ColorSensorMode.ReflectedLightIntensity|block": "reflected light intensity",
"LightCondition.Dark|block": "dark",
"LightIntensityMode.Ambient|block": "ambient light",
"LightIntensityMode.Reflected|block": "reflected light",
"sensors.ColorSensor.color|block": "%sensor| color",
"sensors.ColorSensor.light|block": "%sensor|%mode",
"sensors.ColorSensor.onColorDetected|block": "on %sensor|detected color %color",
"sensors.ColorSensor.onLightChanged|block": "on %sensor|%mode|%condition",
"sensors.ColorSensor.pauseForColor|block": "pause %sensor|for color %color",
"sensors.ColorSensor.pauseForLight|block": "pause %sensor|for %mode|light %condition",
"sensors.color1|block": "color 1",
"sensors.color2|block": "color 2",
"sensors.color3|block": "color 3",
"sensors.color4|block": "color 4",
"sensors|block": "sensors",
"{id:category}Sensors": "Sensors",
"{id:group}Color Sensor": "Color Sensor"
}

223
libs/color-sensor/color.ts Normal file
View File

@ -0,0 +1,223 @@
const enum ColorSensorMode {
None = -1,
//% block="reflected light intensity"
ReflectedLightIntensity = 0,
//% block="ambient light intensity"
AmbientLightIntensity = 1,
//% block="color"
Color = 2,
RefRaw = 3,
RgbRaw = 4,
ColorCal = 5,
}
enum LightIntensityMode {
//% block="reflected light"
Reflected = ColorSensorMode.ReflectedLightIntensity,
//% block="ambient light"
Ambient = ColorSensorMode.AmbientLightIntensity
}
const enum ColorSensorColor {
//% block="none"
None,
//% block="black"
Black,
//% block="blue"
Blue,
//% block="green"
Green,
//% block="yellow"
Yellow,
//% block="red"
Red,
//% block="white"
White,
//% block="brown"
Brown,
}
enum LightCondition {
//% block="dark"
Dark = sensors.internal.ThresholdState.Low,
//$ block="bright"
Bright = sensors.internal.ThresholdState.High
}
namespace sensors {
/**
* The color sensor is a digital sensor that can detect the color or intensity
* of light that enters the small window on the face of the sensor.
*/
//% fixedInstances
export class ColorSensor extends internal.UartSensor {
thresholdDetector: sensors.internal.ThresholdDetector;
constructor(port: number) {
super(port)
this.thresholdDetector = new sensors.internal.ThresholdDetector(this.id());
}
_colorEventValue(value: number) {
return 0xff00 | value;
}
_deviceType() {
return DAL.DEVICE_TYPE_COLOR
}
setMode(m: ColorSensorMode) {
this._setMode(m)
}
/**
* Gets the current color mode
*/
colorMode() {
return <ColorSensorMode>this.mode;
}
_query() {
if (this.mode == ColorSensorMode.Color
|| this.mode == ColorSensorMode.AmbientLightIntensity
|| this.mode == ColorSensorMode.ReflectedLightIntensity)
return this.getNumber(NumberFormat.UInt8LE, 0)
return 0
}
_update(prev: number, curr: number) {
if (this.mode == ColorSensorMode.Color)
control.raiseEvent(this._id, this._colorEventValue(curr));
else
this.thresholdDetector.setLevel(curr);
}
/**
* Registers code to run when the given color is detected.
* @param color the color to detect, eg: ColorSensorColor.Blue
* @param handler the code to run when detected
*/
//% help=sensors/color-sensor/on-color-detected
//% block="on %sensor|detected color %color"
//% blockId=colorOnColorDetected
//% parts="colorsensor"
//% blockNamespace=sensors
//% weight=100 blockGap=8
//% group="Color Sensor"
onColorDetected(color: ColorSensorColor, handler: () => void) {
this.setMode(ColorSensorMode.Color)
const v = this._colorEventValue(<number>color);
control.onEvent(this._id, v, handler);
if (this.color() == color)
control.raiseEvent(this._id, v);
}
/**
* Waits for the given color to be detected
* @param color the color to detect
*/
//% help=sensors/color-sensor/pause-for-color
//% block="pause %sensor|for color %color"
//% blockId=colorPauseForColorDetected
//% parts="colorsensor"
//% blockNamespace=sensors
//% weight=99 blockGap=8
//% group="Color Sensor"
pauseForColor(color: ColorSensorColor) {
this.setMode(ColorSensorMode.Color);
if (this.color() != color) {
const v = this._colorEventValue(<number>color);
control.waitForEvent(this._id, v);
}
}
/**
* Get the current color from the color sensor.
* @param sensor the color sensor to query the request
*/
//% help=sensors/color-sensor/color
//% block="%sensor| color"
//% blockId=colorGetColor
//% parts="colorsensor"
//% blockNamespace=sensors
//% weight=99
//% group="Color Sensor"
color(): ColorSensorColor {
this.setMode(ColorSensorMode.Color)
return this.getNumber(NumberFormat.UInt8LE, 0)
}
/**
* Registers code to run when the ambient light changes.
* @param condition the light condition
* @param handler the code to run when detected
*/
//% help=sensors/color-sensor/on-light-changed
//% block="on %sensor|%mode|%condition"
//% blockId=colorOnLightChanged
//% parts="colorsensor"
//% blockNamespace=sensors
//% weight=89 blockGap=8
//% group="Color Sensor"
onLightChanged(mode: LightIntensityMode, condition: LightCondition, handler: () => void) {
this.setMode(<ColorSensorMode><number>mode)
control.onEvent(this._id, <number>condition, handler);
}
/**
* Waits for the given color to be detected
* @param color the color to detect
*/
//% help=sensors/color-sensor/pause-for-light
//% block="pause %sensor|for %mode|light %condition"
//% blockId=colorPauseForLight
//% parts="colorsensor"
//% blockNamespace=sensors
//% weight=88 blockGap=8
//% group="Color Sensor"
pauseForLight(mode: LightIntensityMode, condition: LightCondition) {
this.setMode(<ColorSensorMode><number>mode)
if (this.thresholdDetector.state != <number>condition)
control.waitForEvent(this._id, <number>condition)
}
/**
* Measures the ambient or reflected light value from 0 (darkest) to 100 (brightest).
* @param sensor the color sensor port
*/
//% help=sensors/color-sensor/light
//% block="%sensor|%mode"
//% blockId=colorLight
//% parts="colorsensor"
//% blockNamespace=sensors
//% weight=87
//% group="Color Sensor"
light(mode: LightIntensityMode) {
this.setMode(<ColorSensorMode><number>mode)
return this.getNumber(NumberFormat.UInt8LE, 0)
}
//%
ambientLight() {
return this.light(LightIntensityMode.Ambient);
}
//%
reflectedLight() {
return this.light(LightIntensityMode.Reflected);
}
}
//% whenUsed block="color 1" weight=95 fixedInstance jres=icons.port1
export const color1: ColorSensor = new ColorSensor(1)
//% whenUsed block="color 2" weight=90 fixedInstance jres=icons.port2
export const color2: ColorSensor = new ColorSensor(2)
//% whenUsed block="color 3" weight=90 fixedInstance jres=icons.port3
export const color3: ColorSensor = new ColorSensor(3)
//% whenUsed block="color 4" weight=90 fixedInstance jres=icons.port4
export const color4: ColorSensor = new ColorSensor(4)
}

Some files were not shown because too many files have changed in this diff Show More