Skip to content

Commit

Permalink
Fixed a bug where serial wasn't disabled on the RPi4
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrius committed Sep 12, 2019
1 parent 61a367c commit fe1c1f0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 10.0.3 (2019-9-12)

- Fixed a bug where serial wasn't being disabled on the RPi 4

## 10.0.2 (2019-4-15)

- Fixed a bug where GPIO pins were not marked as PWM pins correctly
Expand Down
11 changes: 7 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "raspi-io",
"version": "10.0.2",
"version": "10.0.3",
"description": "A Firmata-compatible Raspberry Pi I/O API",
"main": "dist/index.js",
"repository": {
Expand Down
22 changes: 13 additions & 9 deletions src/index.ts
Expand Up @@ -26,11 +26,12 @@ import { J5IO, IOptions as IJ5IOOptions } from 'j5-io';
import { IPinInfo, PeripheralType } from 'j5-io-types';
import {
getPins, getBoardRevision, getPinNumber,
VERSION_3_MODEL_A_PLUS,
VERSION_3_MODEL_B,
VERSION_3_MODEL_B_PLUS,
VERSION_1_MODEL_ZERO_W,
VERSION_1_MODEL_B_REV_1
VERSION_1_MODEL_B_REV_1,
VERSION_1_MODEL_B_REV_2,
VERSION_1_MODEL_B_PLUS,
VERSION_1_MODEL_A_PLUS,
VERSION_1_MODEL_ZERO,
VERSION_2_MODEL_B
} from 'raspi-board';
import { module as base } from 'raspi';
import { module as gpio } from 'raspi-gpio';
Expand Down Expand Up @@ -67,11 +68,14 @@ export function RaspiIO({ includePins, excludePins, enableSerial, enableI2C = tr
}

if (typeof enableSerial === 'undefined') {
const boardRevision = getBoardRevision();
enableSerial =
getBoardRevision() !== VERSION_3_MODEL_B &&
getBoardRevision() !== VERSION_3_MODEL_A_PLUS &&
getBoardRevision() !== VERSION_3_MODEL_B_PLUS &&
getBoardRevision() !== VERSION_1_MODEL_ZERO_W;
boardRevision === VERSION_1_MODEL_B_REV_1 ||
boardRevision === VERSION_1_MODEL_B_REV_2 ||
boardRevision === VERSION_1_MODEL_B_PLUS ||
boardRevision === VERSION_1_MODEL_A_PLUS ||
boardRevision === VERSION_1_MODEL_ZERO ||
boardRevision === VERSION_2_MODEL_B;
}
if (enableSerial) {
options.platform.serial = serial;
Expand Down

0 comments on commit fe1c1f0

Please sign in to comment.