Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Jongboom janjongboom

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am janjongboom on github.
  • I am janjongboom_ei (https://keybase.io/janjongboom_ei) on keybase.
  • I have a public key ASBw8qHhTjPwmtNwu1g_Aqjb5STs958rb5JFtxrorS7hwAo

To claim this, I am signing this object:

@janjongboom
janjongboom / fsb.md
Last active Mar 7, 2019
Mbed OS + The Things Network (setting frequency sub band)
View fsb.md

You might have trouble connecting your Mbed OS device to The Things Network if you're in the US. The reason is that there are 72 channels available in the US, but your gateway is only listening to 8 channels. You can limit the channels that the Mbed OS LoRaWAN stack is using by setting the fsb-mask option. TTN is using FSB 1.

In your Mbed OS project, open mbed_app.json and add under target_overrides:

           "lora.phy": "US915",
           "lora.fsb-mask": "{0xFF00, 0x0000, 0x0000, 0x0000, 0x0002}",

And re-compile.

@janjongboom
janjongboom / 1_instructions.md
Created Jun 18, 2018
DISCO_F413ZH debugging with OpenOCD and Visual Studio Code
View 1_instructions.md
  1. Download OpenOCD.

  2. Place the folder in ~/openocd - so that the scripts is directly under ~/openocd/scripts.

  3. Add it to your PATH via:

    ln -s ~/openocd/bin/openocd /usr/local/bin/openocd

  4. Make sure no applications are bound to port 3333.

  5. Place launch.json and tasks.json in your .vscode folder.

    Note: Set the right path in debugServerArgs.

View jerryscript.patch
diff --git a/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp b/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp
index 7edae943..bb361542 100644
--- a/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp
+++ b/targets/mbedos5/jerryscript-mbed/jerryscript-mbed-drivers/source/DigitalOut-js.cpp
@@ -92,31 +92,6 @@ DECLARE_CLASS_FUNCTION(DigitalOut, read) {
return jerry_create_number(result);
}
-/**
- * DigitalOut#is_connected (native JavaScript method)
@janjongboom
janjongboom / DebounceInterruptIn.h
Created Nov 21, 2017
Mbed OS DebounceInterruptIn
View DebounceInterruptIn.h
// This is a wrapper around InterruptIn, which can debounce
#ifndef _DEBOUNCE_INTERRUPT_IN
#define _DEBOUNCE_INTERRUPT_IN
#if defined (DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY)
#include "mbed.h"
namespace mbed {
@janjongboom
janjongboom / debian64.sh
Last active Nov 8, 2017
Mbed CLI install script
View debian64.sh
#!/bin/bash
cwd=$(pwd)
DIR=$(dirname $(readlink -f $0))
echo "This application will install Mbed CLI..."
sudo apt-get update
sudo apt -y install dh-autoreconf build-essential libncurses5-dev
View main.cpp
#include "mbed.h"
#include "easy-connect.h"
#include "http_request.h"
Serial pc(USBTX, USBRX);
void dump_response(HttpResponse* res) {
printf("Status: %d - %s\n", res->get_status_code(), res->get_status_message().c_str());
printf("Headers:\n");
@janjongboom
janjongboom / PinNames.h
Created Aug 28, 2017
NUCLEO_F207ZG JerryScript PinNames.h
View PinNames.h
/* mbed Microcontroller Library
*******************************************************************************
* Copyright (c) 2016, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@janjongboom
janjongboom / Makefile
Created Aug 12, 2017
NUCLEO F411RE mbed OS 5.5 blinky makefile
View Makefile
# This file was automagically generated by mbed.org. For more information,
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
###############################################################################
# Boiler-plate
# cross-platform directory manipulation
ifeq ($(shell echo $$OS),$$OS)
MAKEDIR = if not exist "$(1)" mkdir "$(1)"
RM = rmdir /S /Q "$(1)"
View firebase.cpp
#include "mbed.h"
#include "easy-connect.h"
#include "https_request.h"
Serial pc(USBTX, USBRX);
/* List of trusted root CA certificates
* This is the root CA for Google from GeoTrustGlobalCA
*
* To add more root certificates, just concatenate them.
You can’t perform that action at this time.