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.
Dependencies: mbed
Diff: src/boards.cpp
- Revision:
- 25:8bcc8bea0e31
- Parent:
- 22:2c37ac12746e
- Child:
- 26:55e8e1a9cc84
diff -r 078f62c8d0ed -r 8bcc8bea0e31 src/boards.cpp
--- a/src/boards.cpp Fri Jan 18 20:17:55 2019 +0000
+++ b/src/boards.cpp Sun Jan 20 16:56:52 2019 +0000
@@ -61,18 +61,28 @@
}
/*******************************************************************************
+setBoardControls
+*******************************************************************************/
+void setBoardControls(unsigned int tCode)
+{
+ for(unsigned int b=0; b<max_boards; b++){
+ en_out = bCodeRow[b];
+ wr_out = 0;
+ wr_out = 1<<b;
+ }
+}
+
+/*******************************************************************************
setBoardEnables
*******************************************************************************/
unsigned int setBoardEnables(unsigned int tCode)
{
- if(!all_on){
- wr_out = tCode;
- unsigned int en_out_save = en_out;
- en_out = 0;
- wr_out = ~tCode;
- en_out = en_out_save;
- }
- return tCode;
+ wr_out = tCode;
+ unsigned int en_out_save = en_out;
+ en_out = 0;
+ wr_out = ~tCode;
+ en_out = en_out_save;
+ return tCode;
}
/*******************************************************************************
@@ -80,9 +90,7 @@
*******************************************************************************/
unsigned int setBoardWeights(unsigned int bCode)
{
- if(!all_on){
- en_out = bCode;
- }
+ en_out = bCode;
toggleLatchSignal();
return bCode;
}
@@ -210,11 +218,15 @@
*******************************************************************************/
void updateControls(unsigned short ref){
- unsigned int cBuf = getLUT_thermCode(ref);
- wr_out_code = setBoardEnables(cBuf);
-
- cBuf = getLUT_binCode(ref);
- en_out_code = setBoardWeights(cBuf);
+ unsigned int tBuf = getLUT_thermCode(ref);
+ unsigned int bBuf = getLUT_binCode(ref);
+ if(max_boards <= 3){
+ getLUT_binCodeArray(ref);
+ setBoardControls(tBuf);
+ }else{
+ wr_out_code = setBoardEnables(tBuf);
+ en_out_code = setBoardWeights(bBuf);
+ }
}
void XupdateControls(unsigned short ref){