Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"G29" "A" or "D" fix & number bit operation clean up #2603

Merged
merged 24 commits into from
Feb 10, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b6bd6e3
Improved Leveling Corner menu (#2517)
kisslorand May 12, 2022
1913dd9
Merge branch 'master' of https://github.com/kisslorand/BIGTREETECH-TFT
kisslorand May 12, 2022
4fe70ec
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand May 15, 2022
f727eb0
Merge branch 'master' of https://github.com/kisslorand/BIGTREETECH-TFT
kisslorand May 15, 2022
4b90fbc
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand May 23, 2022
363b845
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Jun 3, 2022
aceac4c
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Jul 6, 2022
ba9400e
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Jul 12, 2022
c865bd2
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Jul 29, 2022
e91abc9
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Aug 19, 2022
ec6950d
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Aug 23, 2022
e6f537f
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Sep 14, 2022
ba4e131
Stage 1 - various fixes
kisslorand Sep 19, 2022
e1083af
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Oct 7, 2022
f064049
Stage 1.1 - ident fix, use popup macro
kisslorand Oct 7, 2022
da94b84
Stage 1.2 - bitwise macros tweak
kisslorand Oct 11, 2022
d878a20
Stage 1.2.1 - more bitwise macros tweaks
kisslorand Oct 16, 2022
d325b93
Stage 1.2.2 - more TOGGLE_BIT
kisslorand Oct 28, 2022
c8efa8a
Merge branch 'master' of https://github.com/bigtreetech/BIGTREETECH-T…
kisslorand Nov 24, 2022
7dc5598
Stage 1.3 - revert some changes > size reduction
kisslorand Nov 25, 2022
5fb7a14
Merge remote-tracking branch 'upstream/master' into Some-fixes
kisslorand Dec 29, 2022
bf73083
Merge remote-tracking branch 'upstream/master' into Some-fixes
kisslorand Jan 11, 2023
b0784d5
Merge remote-tracking branch 'upstream/master' into Some-fixes
kisslorand Feb 5, 2023
cf3914c
Merge branch 'master' into Some-fixes
bigtreetech Feb 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stage 1.2 - bitwise macros tweak
  • Loading branch information
kisslorand committed Oct 11, 2022
commit da94b84a5c00fd30dd773e6e3a72e81fdd040866
16 changes: 8 additions & 8 deletions TFT/src/User/my_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ extern "C" {
// Bitwise macros

// Get bit status at selected index
#define GET_BIT(num, index) ((num >> index) & 1)
#define GET_BIT(num, index) ((num >> (index)) & 1)

// set bit status at selected index to 1
#define SET_BIT_ON(num, index) num = (1 << index) | num
// Set bit status at selected index to 1
#define SET_BIT_ON(num, index) num = num | (1 << (index))

// set bit status at selected index to 0
#define SET_BIT_OFF(num, index) num = num & (~(1 << index))
// Set bit status at selected index to 0
#define SET_BIT_OFF(num, index) num = num & (~(1 << (index)))

// set bit status value (0 or 1) at selected index
#define SET_BIT_VALUE(num, index, value) num = ((value) == 1) ? (1 << index) | num : num & (~(1 << index))
// Set bit status value (0 or 1) at selected index
#define SET_BIT_VALUE(num, index, value) num = (num & (~(1 << (index)))) | ((value) << (index))

// Toggle bit status at selected index
#define TOGGLE_BIT(num, index) num = num ^ (1 << index)
#define TOGGLE_BIT(num, index) num = num ^ (1 << (index))

// Flip all bits
#define FLIP_BITS(num) ~num
Expand Down