Skip to content

Commit

Permalink
Turn function names from snake_case to camel_case.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed Nov 26, 2024
1 parent 8a9b004 commit 67e4d23
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/T1SMacSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class T1SMacSettings : public arduino::Printable

virtual size_t printTo(Print & p) const override;

bool mac_promiscuous_mode() const { return _mac_promiscuous_mode; }
bool mac_tx_cut_through() const { return _mac_tx_cut_through; }
bool mac_rx_cut_through() const { return _mac_rx_cut_through; }
bool isMacPromiscuousModeEnabled() const { return _mac_promiscuous_mode; }
bool isMacTxCutThroughEnabled() const { return _mac_tx_cut_through; }
bool isMacRxCutThroughEnabled() const { return _mac_rx_cut_through; }
};
8 changes: 4 additions & 4 deletions src/T1SPlcaSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class T1SPlcaSettings : public arduino::Printable
virtual size_t printTo(Print & p) const override;


uint8_t node_id() const { return _node_id; }
uint8_t node_count() const { return _node_count; }
uint8_t burst_count() const { return _burst_count; }
uint8_t burst_timer() const { return _burst_timer; }
uint8_t nodeId() const { return _node_id; }
uint8_t nodeCount() const { return _node_count; }
uint8_t burstCount() const { return _burst_count; }
uint8_t burstTimer() const { return _burst_timer; }
};
22 changes: 11 additions & 11 deletions src/microchip/TC6_Arduino_10BASE_T1S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ bool TC6_Arduino_10BASE_T1S::begin(IPAddress const ip_addr,
, &_lw
, _lw.ip.mac
, true /* enable_plca */
, t1s_plca_settings.node_id()
, t1s_plca_settings.node_count()
, t1s_plca_settings.burst_count()
, t1s_plca_settings.burst_timer()
, t1s_mac_settings.mac_promiscuous_mode()
, t1s_mac_settings.mac_tx_cut_through()
, t1s_mac_settings.mac_rx_cut_through()))
, t1s_plca_settings.nodeId()
, t1s_plca_settings.nodeCount()
, t1s_plca_settings.burstCount()
, t1s_plca_settings.burstTimer()
, t1s_mac_settings.isMacPromiscuousModeEnabled()
, t1s_mac_settings.isMacTxCutThroughEnabled()
, t1s_mac_settings.isMacRxCutThroughEnabled()))
return false;

/* Complete initialization. */
Expand Down Expand Up @@ -206,11 +206,11 @@ void TC6_Arduino_10BASE_T1S::service()
{
sys_check_timeouts(); /* LWIP timers - ARP, DHCP, TCP, etc. */

if (_tc6_io->is_interrupt_active())
if (_tc6_io->isInterruptActive())
{
if (TC6_Service(_lw.tc.tc6, false))
{
_tc6_io->release_interrupt();
_tc6_io->releaseInterrupt();
}
} else if (_lw.tc.tc6NeedService)
{
Expand All @@ -229,7 +229,7 @@ bool TC6_Arduino_10BASE_T1S::getPlcaStatus(TC6LwIP_On_PlcaStatus on_plca_status)

bool TC6_Arduino_10BASE_T1S::enablePlca()
{
return TC6Regs_SetPlca(_lw.tc.tc6, true, _t1s_plca_settings.node_id(), _t1s_plca_settings.node_count());
return TC6Regs_SetPlca(_lw.tc.tc6, true, _t1s_plca_settings.nodeId(), _t1s_plca_settings.nodeCount());
}

bool TC6_Arduino_10BASE_T1S::sendWouldBlock()
Expand Down Expand Up @@ -389,7 +389,7 @@ bool TC6_CB_OnSpiTransaction(TC6_t *pInst, uint8_t *pTx, uint8_t *pRx, uint16_t
if (lw == nullptr) {
return false;
}
bool const success = lw->io->spi_transaction(pTx, pRx, len);
bool const success = lw->io->spiTransaction(pTx, pRx, len);
TC6_SpiBufferDone(pInst /* tc6instance */, success /* success */);
return success;
}
Expand Down
6 changes: 3 additions & 3 deletions src/microchip/TC6_Io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ void TC6_Io::onInterrupt()
_int_in++;
}

bool TC6_Io::is_interrupt_active()
bool TC6_Io::isInterruptActive()
{
_int_reported = _int_in;
return (_int_reported != _int_out);
}

void TC6_Io::release_interrupt()
void TC6_Io::releaseInterrupt()
{
if (digitalRead(_irq_pin) == HIGH)
_int_out = _int_reported;
}

bool TC6_Io::spi_transaction(uint8_t const *pTx, uint8_t *pRx, uint16_t const len)
bool TC6_Io::spiTransaction(uint8_t const *pTx, uint8_t *pRx, uint16_t const len)
{
digitalWrite(_cs_pin, LOW);
_spi.beginTransaction(LAN865x_SPI_SETTING);
Expand Down
6 changes: 3 additions & 3 deletions src/microchip/TC6_Io.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class TC6_Io

void onInterrupt();

bool is_interrupt_active();
bool isInterruptActive();

void release_interrupt();
void releaseInterrupt();

bool spi_transaction(uint8_t const *pTx, uint8_t *pRx, uint16_t const len);
bool spiTransaction(uint8_t const *pTx, uint8_t *pRx, uint16_t const len);


private:
Expand Down

0 comments on commit 67e4d23

Please sign in to comment.