Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1fbf9767b58d
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 196629303064
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Nov 23, 2018

  1. firmware: fix illegal IOx manipulation.

    Something like:
    
      IOx |= 0x02;
      IOx &= 0x01;
    
    doesn't guaranteed to work unless both of those are already outputs,
    since writing an 1 (or 0) to an input doesn't change the value read
    back.
    
    In practice this results in weird inconsistent bugs due to board-to-
    board variability.
    
    Fixes GlasgowEmbedded#77.
    whitequark committed Nov 23, 2018
    Copy the full SHA
    1966293 View commit details
Showing with 4 additions and 6 deletions.
  1. +2 −3 firmware/dac_ldo.c
  2. +2 −3 firmware/leds.c
5 changes: 2 additions & 3 deletions firmware/dac_ldo.c
Original file line number Diff line number Diff line change
@@ -15,9 +15,8 @@ static const struct buffer_desc buffers[] = {

void iobuf_init_dac_ldo() {
// Configure I/O buffer pins as open-source/open-drain; they have 100k pulls
IOD &= ~((1<<PIND_ENVA)|(1<<PIND_ENVB));
IOD |= (1<<PIND_OEQ_N);
OED |= ((1<<PIND_ENVA)|(1<<PIND_ENVB)|(1<<PIND_OEQ_N));
IOD = IOD & ~((1<<PIND_ENVA)|(1<<PIND_ENVB)) | (1<<PIND_OEQ_N);
OED |= ((1<<PIND_ENVA)|(1<<PIND_ENVB) | (1<<PIND_OEQ_N));

// Enable I/O buffers
IOD &= ~ (1<<PIND_OEQ_N);
5 changes: 2 additions & 3 deletions firmware/leds.c
Original file line number Diff line number Diff line change
@@ -2,9 +2,8 @@
#include "glasgow.h"

void leds_init() {
IOD |= (1<<PIND_LED_CY);
IOD &= ~( (1<<PIND_LED_FPGA)|(1<<PIND_LED_ACT)|(1<<PIND_LED_ERR));
OED |= (1<<PIND_LED_CY)|(1<<PIND_LED_FPGA)|(1<<PIND_LED_ACT)|(1<<PIND_LED_ERR);
IOD = IOD | (1<<PIND_LED_CY) & ~((1<<PIND_LED_FPGA)|(1<<PIND_LED_ACT)|(1<<PIND_LED_ERR));
OED |= (1<<PIND_LED_CY) | (1<<PIND_LED_FPGA)|(1<<PIND_LED_ACT)|(1<<PIND_LED_ERR);
}

void led_fpga_set(bool on) {