mirror of
https://github.com/jhbruhn/eurorack.git
synced 2025-03-15 02:55:49 +00:00
Fix bugs
This commit is contained in:
parent
c28c870687
commit
63dc7f3d96
3 changed files with 9 additions and 10 deletions
|
@ -7,11 +7,11 @@
|
|||
|
||||
namespace stereo_mix {
|
||||
|
||||
GPIO_TypeDef* kMDacPorts[] = { GPIOB, GPIOB, GPIOB, GPIOB };
|
||||
const uint16_t kMDacPins[] = { GPIO_PIN_8, GPIO_PIN_9, GPIO_PIN_10, GPIO_PIN_11 };
|
||||
GPIO_TypeDef* kOffsetDacPorts[] = { GPIOB, GPIOB, GPIOB, GPIOB };
|
||||
const uint16_t kOffsetDacPins[] = { GPIO_PIN_8, GPIO_PIN_9, GPIO_PIN_10, GPIO_PIN_11 };
|
||||
|
||||
GPIO_TypeDef* kOffsetDacPorts[] = { GPIOA, GPIOB, GPIOB, GPIOC };
|
||||
const uint16_t kOffsetDacPins[] = { GPIO_PIN_15, GPIO_PIN_7, GPIO_PIN_15, GPIO_PIN_13 };
|
||||
GPIO_TypeDef* kMDacPorts[] = { GPIOA, GPIOB, GPIOB, GPIOC };
|
||||
const uint16_t kMDacPins[] = { GPIO_PIN_15, GPIO_PIN_7, GPIO_PIN_15, GPIO_PIN_13 };
|
||||
|
||||
class Dacs { // MCP4xx2 dac implementation
|
||||
public:
|
||||
|
@ -89,11 +89,14 @@ class Dacs { // MCP4xx2 dac implementation
|
|||
value |= 1 << 12; // shutdown always set to 1
|
||||
|
||||
kMDacPorts[device]->BRR |= kMDacPins[device];
|
||||
kOffsetDacPorts[device]->BRR |= kOffsetDacPins[device];
|
||||
SPI1->DR = value;
|
||||
while ((SPI1->SR & (SPI_SR_TXE | SPI_SR_BSY)) != SPI_SR_TXE)
|
||||
;
|
||||
kMDacPorts[device]->BSRR |= kMDacPins[device];
|
||||
kOffsetDacPorts[device]->BRR |= kOffsetDacPins[device];
|
||||
SPI1->DR = value;
|
||||
while ((SPI1->SR & (SPI_SR_TXE | SPI_SR_BSY)) != SPI_SR_TXE)
|
||||
;
|
||||
kOffsetDacPorts[device]->BSRR |= kOffsetDacPins[device];
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
//#define ENABLE_DEBUG_PIN
|
||||
#include "drivers/debug_pin.h"
|
||||
|
||||
#include "drivers/adc.h"
|
||||
#include "drivers/dacs.h"
|
||||
#include "drivers/leds.h"
|
||||
|
|
|
@ -99,7 +99,7 @@ void UI::TaskDrawLeds()
|
|||
{
|
||||
for (size_t i = 0; i < kNumChannels; i++) {
|
||||
if (potControllers[i].editing_hidden_parameter()) {
|
||||
leds->set_intensity_signed(i, volume_att_pots[i]);
|
||||
leds->set_intensity_signed(i, volume_att_pots[i] - 32767);
|
||||
} else if (potControllers[i + kNumChannels].editing_hidden_parameter()) {
|
||||
leds->set_intensity_signed(i, pan_att_pots[i] - 32767);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue