Skip to content

Instantly share code, notes, and snippets.

View clydebarrow's full-sized avatar

Clyde Stubbs clydebarrow

View GitHub Profile
@clydebarrow
clydebarrow / NetworkStatus.kt
Last active March 5, 2021 02:50
Check network reachability on iOS using RoboVM in Kotlin
package com.controlj.framework
import com.controlj.rx.DisposedEmitter
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.ObservableEmitter
import io.reactivex.rxjava3.schedulers.Schedulers
import org.robovm.apple.dispatch.DispatchQueue
import org.robovm.apple.foundation.NSOperatingSystemVersion
import org.robovm.apple.foundation.NSProcessInfo
import org.robovm.apple.network.NWPathMonitor
@clydebarrow
clydebarrow / spiFlash.c
Last active January 25, 2021 23:39
SPI Flash read/write/erase functions for SiLabs EFR32 and friends.
//
// Created by Clyde Stubbs on 13/1/21.
//
#include <spiFlash.h>
#include <em_gpio.h>
#include <em_usart.h>
#include <em_ldma.h>
// Command bytes for the serial flash S25FL164K