Skip to content

Instantly share code, notes, and snippets.

@scls19fr
Last active October 27, 2018 06:45
Show Gist options
  • Save scls19fr/0e95131dc3ec6cd061da11377445215d to your computer and use it in GitHub Desktop.
Save scls19fr/0e95131dc3ec6cd061da11377445215d to your computer and use it in GitHub Desktop.
@scls19fr
Copy link
Author

function Board(s::AbstractString)
    s = lowercase(s)
    if s in ["", "rpi", "raspberry"]
        RaspberryPiBoard()
    elseif s in ["ghost"]
        GhostBoard()
    else
        error("'$s' is not an allowed board")
    end
end

function Board()
    Board("")
end

Should provide a register function

register!(Pingo.SUPPORTED_BOARDS, RaspberryPiBoard, ["rpi", "raspberry", "raspberrypi"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment