From 8178c18ce84ef1e0a017edd3f84bac6942f0c453 Mon Sep 17 00:00:00 2001 From: Marcin Kondej Date: Sun, 26 Dec 2021 23:50:39 +0100 Subject: [PATCH] Removed default constructors --- transmitter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/transmitter.cpp b/transmitter.cpp index d914ba4..3498f0c 100644 --- a/transmitter.cpp +++ b/transmitter.cpp @@ -220,6 +220,7 @@ class Device class ClockDevice : public Device { public: + ClockDevice() = delete; ClockDevice(uintptr_t clockAddress, unsigned divisor) { clock = reinterpret_cast(peripherals->GetVirtualAddress(clockAddress)); clock->ctl = (0x5a << 24) | 0x06; @@ -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(peripherals->GetVirtualAddress(GPIO_BASE_OFFSET)); @@ -267,6 +269,7 @@ class ClockOutput : public ClockDevice class PWMController : public ClockDevice { public: + PWMController() = delete; PWMController(unsigned sampleRate) : ClockDevice(PWMCLK_BASE_OFFSET, static_cast(Peripherals::GetClockFrequency() * 1000000.f * (0x01 << 12) / (PWM_WRITES_PER_SAMPLE * PWM_CHANNEL_RANGE * sampleRate))) { pwm = reinterpret_cast(peripherals->GetVirtualAddress(PWM_BASE_OFFSET)); pwm->ctl = 0x00000000; @@ -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(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() {