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.
Diff: bit_set.cpp
- Revision:
- 3:2a301290cf76
- Parent:
- 2:eeaee1039d50
- Child:
- 4:9b24dd4dff68
--- a/bit_set.cpp Mon Sep 09 08:02:33 2019 +0000
+++ b/bit_set.cpp Tue Sep 10 00:27:03 2019 +0000
@@ -7,12 +7,12 @@
void bitset(char var,int cons)
{
- var |= 2^cons;
+ var |= 0x01<<cons;
}
void bitclear(char var,int cons)
{
- var &= ~(2^cons);
+ var &= ~(0x01<<cons);
}
void bit_ini(char* var)
@@ -22,15 +22,15 @@
void bit_set(char* var,int cons)
{
- *var |= 2^cons;
+ *var |= 0x01<<cons;
}
void bit_clear(char* var,int cons)
{
- *var &= ~(2^cons);
+ *var &= ~(0x01<<cons);
}
bool bitcheck(char var,int cons)
{
- return (var &= 2^cons)?true:false;
+ return (var &= 0x01<<cons)?true:false;
}
\ No newline at end of file