Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 30, 2024
1 parent a82d809 commit 4a6baee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions cpp/buses/rpi_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ void RpiBus::Reset()
SetControl(PIN_ACT, false);

// Set all signals to off
for (const int signal : SIGNAL_TABLE) {
SetSignal(signal, false);
for (const int s : SIGNAL_TABLE) {
SetSignal(s, false);
}

// Set target signal to input for all modes
Expand All @@ -234,15 +234,6 @@ void RpiBus::Reset()
signals = 0;
}

void RpiBus::InitializeSignals(int pull_mode)
{
for (const int signal : SIGNAL_TABLE) {
PinSetSignal(signal, false);
PinConfig(signal, GPIO_INPUT);
PullConfig(signal, pull_mode);
}
}

bool RpiBus::WaitForSelection()
{
#ifndef __linux__
Expand Down Expand Up @@ -335,6 +326,15 @@ inline void RpiBus::SetDAT(uint8_t dat)
gpio[GPIO_FSEL_1] = fsel;
}

void RpiBus::InitializeSignals(int pull_mode)
{
for (const int s : SIGNAL_TABLE) {
PinSetSignal(s, false);
PinConfig(s, GPIO_INPUT);
PullConfig(s, pull_mode);
}
}

void RpiBus::CreateWorkTable()
{
array<bool, 256> tblParity;
Expand Down
16 changes: 8 additions & 8 deletions cpp/devices/host_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,19 @@ void HostServices::AddRealtimeClockPage(map<int, vector<byte>> &pages, bool chan

if (!changeable) {
const time_t &t = system_clock::to_time_t(system_clock::now());
tm localtime;
localtime_r(&t, &localtime);
tm local_time;
localtime_r(&t, &local_time);

ModePageDateTime datetime;
datetime.major_version = 0x01;
datetime.minor_version = 0x00;
datetime.year = static_cast<uint8_t>(localtime.tm_year);
datetime.month = static_cast<uint8_t>(localtime.tm_mon);
datetime.day = static_cast<uint8_t>(localtime.tm_mday);
datetime.hour = static_cast<uint8_t>(localtime.tm_hour);
datetime.minute = static_cast<uint8_t>(localtime.tm_min);
datetime.year = static_cast<uint8_t>(local_time.tm_year);
datetime.month = static_cast<uint8_t>(local_time.tm_mon);
datetime.day = static_cast<uint8_t>(local_time.tm_mday);
datetime.hour = static_cast<uint8_t>(local_time.tm_hour);
datetime.minute = static_cast<uint8_t>(local_time.tm_min);
// Ignore leap second for simplicity
datetime.second = static_cast<uint8_t>(localtime.tm_sec < 60 ? localtime.tm_sec : 59);
datetime.second = static_cast<uint8_t>(local_time.tm_sec < 60 ? local_time.tm_sec : 59);

memcpy(&pages[32][2], &datetime, sizeof(datetime));
}
Expand Down

0 comments on commit 4a6baee

Please sign in to comment.