Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UIT2_MovingAverage UIT2_AllpassReverb UIT2_CombReverb UIT2_FIR_LPF_Symmetry ... more
Diff: DAC_MCP4922.cpp
- Revision:
- 17:fd4f92ad4323
- Parent:
- 16:0001d3e93bee
- Child:
- 18:0bfced9d5526
--- a/DAC_MCP4922.cpp Sun Jan 11 02:20:04 2015 +0000
+++ b/DAC_MCP4922.cpp Thu Jan 29 05:52:57 2015 +0000
@@ -1,7 +1,7 @@
//------------------------------------------------------
// Class for single DAC in MCP4922
//
-// 2015/01/03, Copyright (c) 2015 MIKAMI, Naoki
+// 2015/01/29, Copyright (c) 2015 MIKAMI, Naoki
//------------------------------------------------------
#include "DAC_MCP4922.hpp"
@@ -29,7 +29,8 @@
// timer prescaler is set same value of boud rate for SPI
uint16_t psc = (2 << ((mySpi_->CR1 >> 3) & 0x07)) - 1;
- ss_ = new Tim4_ss(psc, 18, cs);
+ if (mySpi_ != SPI1) psc = (psc + 1)*2 - 1;
+ ss_ = new Tim4_ss(psc, 19, cs);
// Set DAC to 0
WriteDac(0);