This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| wakeup(){ | |
| wakeup=/proc/acpi/wakeup | |
| if [ "$#" -lt 2 ]; then | |
| devices=$(grep -e 'bled' $wakeup | cut -f 1 | tr -s '\n' ' ') | |
| echo "$0 disable|enable [ $devices]" | |
| return 1 | |
| fi | |
| case $1 in | |
| *dis*) state="enabled" ; msg="disabling" ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/false | |
| # This file is part of Espruino, a JavaScript interpreter for Microcontrollers | |
| # | |
| # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> | |
| # | |
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
| # | |
| # ---------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/false | |
| # This file is part of Espruino, a JavaScript interpreter for Microcontrollers | |
| # | |
| # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> | |
| # | |
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
| # | |
| # ---------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/false | |
| # This file is part of Espruino, a JavaScript interpreter for Microcontrollers | |
| # | |
| # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> | |
| import pinutils; | |
| info = { | |
| 'name' : "Magic 3", | |
| 'link' : [ "https://www.kospet.com/products/kospet-magic-3" ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| E.kickWatchdog(); | |
| function KickWd(){ | |
| if( (typeof(BTN1)=='undefined')||(!BTN1.read()) ) E.kickWatchdog(); | |
| } | |
| var wdint=setInterval(KickWd,2000); | |
| E.enableWatchdog(15, false); | |
| /* | |
| // MIT License (c) 2020 fanoush https://github.com/fanoush | |
| // see full license text at https://choosealicense.com/licenses/mit/ | |
| var SPI2 = E.compiledC(` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| E.kickWatchdog(); | |
| function KickWd(){ | |
| if( (typeof(BTN1)=='undefined')||(!BTN1.read()) ) E.kickWatchdog(); | |
| } | |
| var wdint=setInterval(KickWd,2000); | |
| E.enableWatchdog(15, false); | |
| // MIT License (c) 2020 fanoush https://github.com/fanoush | |
| // see full license text at https://choosealicense.com/licenses/mit/ | |
| // SPI display driver below compiled with options LCD_BPP=12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| E.kickWatchdog(); | |
| function KickWd(){ | |
| if( (typeof(BTN1)=='undefined')||(!BTN1.read()) ) E.kickWatchdog(); | |
| } | |
| var wdint=setInterval(KickWd,2000); | |
| E.enableWatchdog(15, false); | |
| // set name to F10 | |
| // NRF.setAdvertising({},{name:"F10 "+NRF.getAddress().split(':').slice(-2).join('')}); | |
| var SPI2 = (function(){ | |
| var bin=atob("AAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////8QtQNMfEQigGCAoYDjgBC92P///wdLe0QbiUOxBEoTaAAr/NAAIxNgA0p6RBOBcEcYMQJAxv///7L///8t6fBHkEYZTBlO//fl/xlK3/hkwAAjASUTYE/w/w5TYKlGI2AQMh9G/ykA6wMKwvgAoIu//zMxYMb4AOAAIYi//znM+ACQuPEADwbQKbkLS3tEHYEAIL3o8IfU+ACguvEAD/rQJ2AAKd7R8+cYMQJASDUCQDQ1AkAQMAJAUP///y3p8E+bsM3pARJQSnpEBkaS+ACQACgA8JGAACkA8I6ACfH/MwcrAPKJgAEjA/oJ8wE727IDkwR4Q3iXiETqAyQCmxxB02gA8QILpLILsT1KE2BP6kkD27IEkz1Le0QRqAWTCKvN6QYwT/AACEFGBZsCnbP4AqADmwGaI0BE+gn0MvgTwAObI0BE+gn0MvgTIASbHUTtsgctQNiksk/qLBNDVBMSAfECDkPqDBxDGAMxqvECCiMpg/gBwB/6ivoA+A4gCd0BIv/3W//Y8QEIC78HmAaYQUYAIbrxAA/L0R1Le0QBP9uIHkS/snN4NHhE6gMkApscQQbxAguksgAvttHJsTpG//c8/xNLe0TYaBCxDUsYYAAgG7C96PCP3kYIPR74ATvtssXxCAsD+gvzHEOksvN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function KickWd(){ | |
| if(!BTN1.read())E.kickWatchdog(); | |
| } | |
| var wdint=setInterval(KickWd,5000); // 5 secs | |
| E.enableWatchdog(20, false); // 20 secs | |
| E.kickWatchdog(); | |
| /* | |
| // MIT License (c) 2020 fanoush https://github.com/fanoush | |
| // see full license text at https://choosealicense.com/licenses/mit/ | |
| var SPI2 = E.compiledC(` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // -- 0. check https://github.com/fanoush/ds-d6/wiki/Replacing-Nordic-DFU-bootloader for fixing MBR settings UICR at 0x10001018 | |
| // this is needed before flashing any softdevice/bootloader upgrading/downgrading package | |
| // basically peek32(0x10001018).toString(16); shoud return 0x7e000 and not 0xffffffff or you will brick device by downgrading SDK/SoftrDevice !!! | |
| /* something like this should work (+disconnect/reconnect) | |
| NRF.onRestart=function(){ | |
| poke32(0x4001e504,1);while(!peek32(0x4001e400)); // enable flash writing | |
| poke32(0x10001018,0x7E000);while(!peek32(0x4001e400)); // set mbr settings | |
| poke32(0x4001e504, 0);while(!peek32(0x4001e400)); // disable flash writing | |
| } | |
| NRF.restart(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/jswrap_process.c b/src/jswrap_process.c | |
| index f6c738c3..21470116 100644 | |
| --- a/src/jswrap_process.c | |
| +++ b/src/jswrap_process.c | |
| @@ -126,6 +126,9 @@ JsVar *jswrap_process_env() { | |
| #ifndef SAVE_ON_FLASH | |
| // Pointer to a list of predefined exports - eventually we'll get rid of the array above | |
| jsvObjectSetChildAndUnLock(obj, "EXPTR", jsvNewFromInteger((JsVarInt)(size_t)exportPtrs)); | |
| +extern uint32_t app_ram_base; | |
| + jsvObjectSetChildAndUnLock(obj, "APP_RAM_BASE", jsvNewFromInteger((JsVarInt)app_ram_base)); |
NewerOlder