Skip to content

Commit 6dd13b1

Browse files
committed
Use const on all uint8_t params
1 parent 1098501 commit 6dd13b1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

libraries/OPAMP/src/OPAMP.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static const opamp_channel_pins_t opamp_channels[] = {
2727
{BSP_IO_PORT_00_PIN_05, BSP_IO_PORT_00_PIN_06, BSP_IO_PORT_00_PIN_07}, /* CH3 */
2828
};
2929

30-
bool OpampClass::initPins(uint8_t channel_mask) {
30+
bool OpampClass::initPins(uint8_t const channel_mask) {
3131
fsp_err_t err;
3232
ioport_instance_ctrl_t ioport_ctrl {};
3333
// Make sure to return false if nothing was given to initialize
@@ -53,7 +53,7 @@ bool OpampClass::initPins(uint8_t channel_mask) {
5353
return true;
5454
}
5555

56-
void OpampClass::initOpamp(OpampSpeedMode speed, uint8_t channel_mask) {
56+
void OpampClass::initOpamp(OpampSpeedMode speed, uint8_t const channel_mask) {
5757
uint8_t ampmc_val = 0U;
5858
/* setup amplifier speed mode within amplifier mode control */
5959
/* for all boards, this is at bit position 7 with either 0 (lowspeed) or 1 (highspeed) */
@@ -85,7 +85,7 @@ bool OpampClass::begin(OpampSpeedMode speed) {
8585
return this->begin(1u << ARDUINO_DEFAULT_OPAMP_CHANNEL, speed);
8686
}
8787

88-
bool OpampClass::begin(uint8_t channel_mask, OpampSpeedMode speed) {
88+
bool OpampClass::begin(uint8_t const channel_mask, OpampSpeedMode speed) {
8989
if (!initPins(channel_mask)) {
9090
return false;
9191
}
@@ -102,7 +102,7 @@ void OpampClass::end() {
102102
R_OPAMP->AMPC = 0;
103103
}
104104

105-
void OpampClass::end(uint8_t channel_mask) {
105+
void OpampClass::end(uint8_t const channel_mask) {
106106
// deactivate given channels
107107
R_OPAMP->AMPC &= ~channel_mask;
108108
}

libraries/OPAMP/src/OPAMP.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ class OpampClass {
3535
/* startup the OPAMP on channel 0 with specific mode */
3636
bool begin(OpampSpeedMode speed);
3737
/* startup the OPAMP with arbitrary channel mask */
38-
bool begin(uint8_t channel_mask, OpampSpeedMode speed);
38+
bool begin(uint8_t const channel_mask, OpampSpeedMode speed);
3939
/* stop all OPAMP channels */
4040
void end();
4141
/* stop specific OPAMP channel(s) */
42-
void end(uint8_t channel_mask);
42+
void end(uint8_t const channel_mask);
4343
/* returns true if the specified OPAMP channel number is running */
4444
bool isRunning(uint8_t const channel);
4545
private:
4646
/* initializes OPAMP pins for given channel(s) */
47-
bool initPins(uint8_t channel_mask);
47+
bool initPins(uint8_t const channel_mask);
4848
/* activates OPAMP for given speed and channel(s) */
49-
void initOpamp(OpampSpeedMode speed, uint8_t channel_mask);
49+
void initOpamp(OpampSpeedMode speed, uint8_t const channel_mask);
5050
};
5151

5252
extern OpampClass OPAMP;

0 commit comments

Comments
 (0)