Skip to content
Snippets Groups Projects
Select Git revision
  • labcomm2014
  • labcomm2006
  • master default
  • python_sig_hash
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.6
  • v2015.0
  • v2014.5
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
20 results

LabComm.ast

Blame
  • SysLED.jl NaN GiB
    """
    The on-board leds with id ∈ [1,2,3,4]
    """
    struct SysLED
    end
    
    function write!(::SysLED, ind::Int32, val::Bool, debug::Bool=false)
        debug && return
        ind  [1,2,3,4] && error("Invalid SysLEND ind: $ind")
        filename = "/sys/class/leds/beaglebone:green:usr$(ind-1)/brightness"
        file = open(filename, "r+")
        write(file, val ? "1" : "0")
        close(file)
        return
    end
    function read(::SysLED, ind::Int32, debug::Bool=false)
        debug && return
        ind  [1,2,3,4] && error("Invalid SysLEND ind: $ind")
        filename = "/sys/class/leds/beaglebone:green:usr$(ind-1)/brightness"
        file = open(filename, "r")
        l = readline(file)
        (l != "1" && l != "0") && error("Invalid value \"$l\" read from SysLed")
        close(file)
        return l == "1"
    end