ADC on a SAMD21 always gives zero values, except when using breakpoints in its interrupt
The ADC has both negative and positive inputs, but it seems it is not just merely an optional extra feature. I have to specify a negative input, even if I only use the positive one. (the datasheet is a little unclear here, it only mentions both inputs being used in the calculation if I choose differential input in CTRLB.DIFFMODE, which wasn't the case here)

After setting the negative input to the internal ground, 

ADC-&gt;INPUTCTRL.bit.MUXNEG = 0x18;


everything works as expected.

I still don't understand why it was working when a breakpoint was set, but at least the code works as it should.