Skip to content

Commit

Permalink
☠️
Browse files Browse the repository at this point in the history
  • Loading branch information
johntalton committed May 6, 2024
1 parent ef52717 commit c592198
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
assignees:
- "octocat"
commit-message:
# Prefix all commit messages with "npm"
prefix: "NPM"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
assignees:
- "octocat"
commit-message:
prefix: "GitHub-Actions"
15 changes: 15 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on: push

jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: npm run build --if-present
- run: npm run lint --if-present
- run: npm run test --if-present
- run: npm run coverage --if-present
19 changes: 19 additions & 0 deletions .github/workflows/RELEASE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish (NPM / GitHub)
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Publish to NPM
- uses: actions/[email protected]
with:
registry-url: 'https://registry.npmjs.org/'
- run: npm install
- run: npm run build --if-present
- run: npm run format --if-present
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# excamera-i2cdriver
excamera labs I2CDriver

[![npm Version](http://img.shields.io/npm/v/@johntalton/excamera-i2cdriver.svg)](https://www.npmjs.com/package/@johntalton/excamera-i2cdriver)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/excamera-i2cdriver)
![CI](https://github.com/johntalton/excamera-i2cdriver/workflows/CI/badge.svg)
![GitHub](https://img.shields.io/github/license/johntalton/excamera-i2cdriver)
[![Downloads Per Month](http://img.shields.io/npm/dm/@johntalton/excamera-i2cdriver.svg)](https://www.npmjs.com/package/@johntalton/excamera-i2cdriver)
![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/excamera-i2cdriver)

Excamera labs I2CDriver

Provides a JavaScript API for the i²c driver. Works well in the browser via [SerialPort](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort)

# Capture Mode

Capture mode is supported via function generator stream.

The `eventStreamFromReader` factory can be called with a `ReadableStream` to create state-machine stream that will `yield` the i²c events.

This can be used to replicate the excameras native visualization as the raw date is provided for each event. (alternatively constructing a function generator from lower level components)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"./capture": "./src/capture-generator/index.js",
"./package.json": "./package.json"
},
"files": [ "src/**/*.js"],
"scripts": {
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/i2c-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export class ExcameraLabsI2CDriver {
return this.sendRecvCommand(port, command, sendBuffer, recvLength)
}

/** @param {SerialPort} port */
static async sendRecvCommand(port, command, sendBuffer, recvLength) {
// console.log('reader state', port.readable.locked, command, sendBuffer, recvLength)
if(port.readable.locked) {
Expand Down

0 comments on commit c592198

Please sign in to comment.