Skip to content

Commit

Permalink
Merge pull request #349 from taartspi/PWM_provider_cleanup
Browse files Browse the repository at this point in the history
Pwm provider cleanup
  • Loading branch information
FDelporte authored Apr 18, 2024
2 parents 2da171d + e482673 commit 2c6399d
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ public DigitalInput create(DigitalInputConfig config) {

@Override
public int getPriority() {
// the gpioD driver should be higher priority when on Rp1 chip
int rval = 0;
if(BoardInfoHelper.usesRP1()) {
rval = 150;
}else{
rval = 150;
}
return(rval);
// the gpioD driver should be higher priority always
return(150);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,8 @@ public DigitalOutput create(DigitalOutputConfig config) {

@Override
public int getPriority() {
// the gpioD driver should be higher priority when on RP1 chip
int rval = 0;
if(BoardInfoHelper.usesRP1()) {
rval = 150;
}else{
rval = 150;
}
return(rval);
// the gpioD driver should be higher priority always
return(150);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ public LinuxFsDigitalInputProviderImpl(String gpioFileSystemPath) {

@Override
public int getPriority() {
// the linux FS Digital driver should be higher priority than Pigpio on RP1 chip
int rval = 0;
// the linux FS Digital driver should be higher priority on RP1 chip
int rval = 50;
if(BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
rval = 50;
}
return(rval);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ public LinuxFsDigitalOutputProviderImpl(String gpioFileSystemPath) {

@Override
public int getPriority() {
// the linux FS Digital driver should be higher priority than Pigpio on RP1 chip.
int rval = 0;
// the linux FS Digital driver should be higher priority on RP1 chip.
int rval = 50;
if(BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
rval = 50;
}
return(rval);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,8 @@ public LinuxFsI2CProviderImpl() {

@Override
public int getPriority() {
// the linux FS driver should be higher priority when on RP1 chip
int rval = 0;
if(BoardInfoHelper.usesRP1()) {
rval = 150;
}else{
rval = 150;
}
return(rval);
// the linux FS driver should always be higher priority
return(150);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ public LinuxFsPwmProviderImpl(String pwmFileSystemPath, int pwmChip) {

@Override
public int getPriority() {
// the linux FS PWM driver should be higher priority than Pigpio on RP1 chip
int rval = 0;
// the linux FS PWM driver should be higher priority on RP1 chip
int rval = 50;
if(BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
rval = 50;
}
return(rval);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ public PiGpioDigitalInputProviderImpl(PiGpio piGpio) {
@Override
public int getPriority() {
// the Pigpio driver should be higher priority when NOT on RP1 chip
int rval = 0;
if(!BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
int rval = 100;
if(BoardInfoHelper.usesRP1()) {
rval = 50;
}
return(rval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ public PiGpioDigitalOutputProviderImpl(PiGpio piGpio) {
@Override
public int getPriority() {
// the Pigpio driver should be higher priority when NOT on RP1 chip.
int rval = 0;
if(!BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
int rval = 100;
if(BoardInfoHelper.usesRP1()) {
rval = 50;
}
return(rval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ public PiGpioI2CProviderImpl(PiGpio piGpio) {
@Override
public int getPriority() {
// the Pigpio driver should be higher priority when NOT on RP1 chip
int rval = 0;
if(!BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
int rval = 100;
if(BoardInfoHelper.usesRP1()) {
rval = 50;
}
return(rval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ public PiGpioPwmProviderImpl(PiGpio piGpio) {
@Override
public int getPriority() {
// the Pigpio driver should be higher priority when NOT on RP1 chip.
int rval = 0;
if(!BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
int rval = 100;
if(BoardInfoHelper.usesRP1()) {
rval = 50;
}
return(rval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ public PiGpioSerialProviderImpl(PiGpio piGpio) {
@Override
public int getPriority() {
// the Pigpio driver should be higher priority when NOT on Rp1 chip.
int rval = 0;
if(!BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
int rval = 100;
if(BoardInfoHelper.usesRP1()) {
rval = 50;
}
return(rval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ public PiGpioSpiProviderImpl(PiGpio piGpio) {
@Override
public int getPriority() {
// the Pigpio driver should be higher priority when NOT on RP1 chip.
int rval = 0;
if(!BoardInfoHelper.usesRP1()) {
rval = 100;
}else{
int rval = 100;
if(BoardInfoHelper.usesRP1()) {
rval = 50;
}
return(rval);

}

/**
Expand Down

0 comments on commit 2c6399d

Please sign in to comment.