Commit Diff


commit - 8211b9cb69a48d026b6d75f215674bf035e974a1
commit + 75150dae92ef956a3dac0f6b85db49cb759b5906
blob - 7b541463b15b7555948c083750fed9bd743bc2bc
blob + 4662e3eb4819c31bb21f4dfd4f82e75fa4329a05
--- Morse.cpp	
+++ Morse.cpp	
@@ -283,7 +283,7 @@ Morse::dac_watchdog(void)
 	if (dac_inited) {
 		dac_handle_chars();
 		if (dac_on) {
-			dac_i += .02;
+			dac_i +=  dac_max / (clk_freq / (dac_freq * 1000));
 			if (dac_i >= dac_max)
 				dac_i = 0.0;
 			volume = (MAX_RAD * (dac_volume / 100.0));
blob - 2c689220dd6e95ff05605aff350c671df17848b2
blob + 61541e081f486bb4ee7461394b59a63c8867246f
--- Morse.h	
+++ Morse.h	
@@ -25,6 +25,8 @@ Morse
 	// we've no rx code yet
 	public:
 		float dac_volume = 100;
+		float dac_freq = 1000;
+		uint64_t clk_freq = getApbFrequency();
 
 		Morse(uint8_t type, uint8_t the_pin);
 		Morse(uint8_t type, uint8_t the_pin, uint8_t the_wpm);