diff --git a/bugs/properPwmSineWave.png b/bugs/properPwmSineWave.png new file mode 100644 index 0000000..d58b9d2 Binary files /dev/null and b/bugs/properPwmSineWave.png differ diff --git a/bugs/unimplementedHardware.txt b/bugs/unimplementedHardware.txt index 12b84e1..458544f 100644 --- a/bugs/unimplementedHardware.txt +++ b/bugs/unimplementedHardware.txt @@ -24,6 +24,7 @@ RxOverflow on SPI1, don't know if back or front of FIFO is overwritten on overfl ICR POL(1,2,3,6) may flip the pin value as well as the interrupt, POL5 does not flip the INT5 pin though, this was confirmed with a hardware test(it doesnt seem to but there is instability on the pin when the SD card is plugged in, this may have to do with card detect also being a data line on the SD pinout) edge triggered INT* don't clear on write to ISR when masked in IMR(at least that seems to be the reason) if a sound interrupt is triggered while the button interrupt is disabled the button interrupt will still trigger(in galax game) +PWM1 output value is not a direct range cast of 0<->255 to 0<->32767, its additive, see properPwmSineWave.png Debug tools: ADS7846 channels can't be read in single reference mode in hwTestSuite diff --git a/src/hardwareRegistersAccessors.c.h b/src/hardwareRegistersAccessors.c.h index 9e29b43..ad22cab 100644 --- a/src/hardwareRegistersAccessors.c.h +++ b/src/hardwareRegistersAccessors.c.h @@ -86,12 +86,10 @@ int32_t pwm1FifoRunSample(int32_t now, int32_t clockOffset){ uint8_t clockDivider = 2 << (pwmc1 & 0x03); uint8_t repeat = 1 << (pwmc1 >> 2 & 0x03); int32_t audioStart = now + clockOffset; - //int32_t audioNow = audioStart; int32_t audioSampleDuration = usingClk32 ? audioGetFramePercentIncrementFromClk32s(period * prescaler * clockDivider * repeat) : audioGetFramePercentIncrementFromSysclks(period * prescaler * clockDivider * repeat); int32_t audioDeew = dMin((double)sample / period, 1.0)/*dutyCycle*/ * AUDIO_AMPLITUDE; blip_add_delta(palmAudioResampler, audioStart, audioDeew - pwm1LastSampleDelta); - //audioNow += audioSampleDuration; pwm1LastSampleDelta = audioDeew; //remove used entry