Skip to content

Commit

Permalink
Removed default constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
markondej committed Dec 26, 2021
1 parent cf29f4a commit 8178c18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions transmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class Device
class ClockDevice : public Device
{
public:
ClockDevice() = delete;
ClockDevice(uintptr_t clockAddress, unsigned divisor) {
clock = reinterpret_cast<ClockRegisters *>(peripherals->GetVirtualAddress(clockAddress));
clock->ctl = (0x5a << 24) | 0x06;
Expand All @@ -237,6 +238,7 @@ class ClockDevice : public Device
class ClockOutput : public ClockDevice
{
public:
ClockOutput() = delete;
#ifndef GPIO21
ClockOutput(unsigned divisor) : ClockDevice(CLK0_BASE_OFFSET, divisor) {
output = reinterpret_cast<uint32_t *>(peripherals->GetVirtualAddress(GPIO_BASE_OFFSET));
Expand Down Expand Up @@ -267,6 +269,7 @@ class ClockOutput : public ClockDevice
class PWMController : public ClockDevice
{
public:
PWMController() = delete;
PWMController(unsigned sampleRate) : ClockDevice(PWMCLK_BASE_OFFSET, static_cast<unsigned>(Peripherals::GetClockFrequency() * 1000000.f * (0x01 << 12) / (PWM_WRITES_PER_SAMPLE * PWM_CHANNEL_RANGE * sampleRate))) {
pwm = reinterpret_cast<PWMRegisters *>(peripherals->GetVirtualAddress(PWM_BASE_OFFSET));
pwm->ctl = 0x00000000;
Expand All @@ -291,12 +294,13 @@ class PWMController : public ClockDevice
class DMAController : public Device
{
public:
DMAController(uint32_t controllBlockAddress, unsigned dmaChannel) {
DMAController() = delete;
DMAController(uint32_t address, unsigned dmaChannel) {
dma = reinterpret_cast<DMARegisters *>(peripherals->GetVirtualAddress((dmaChannel < 15) ? DMA0_BASE_OFFSET + dmaChannel * 0x100 : DMA15_BASE_OFFSET));
dma->ctlStatus = (0x01 << 31);
std::this_thread::sleep_for(std::chrono::microseconds(1000));
dma->ctlStatus = (0x01 << 2) | (0x01 << 1);
dma->cbAddress = controllBlockAddress;
dma->cbAddress = address;
dma->ctlStatus = (0xff << 16) | 0x01;
}
virtual ~DMAController() {
Expand Down

0 comments on commit 8178c18

Please sign in to comment.