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.
bit_set.cpp@1:4b6bf9473b7d, 2019-09-09 (annotated)
- Committer:
- yosino_adati
- Date:
- Mon Sep 09 07:46:09 2019 +0000
- Revision:
- 1:4b6bf9473b7d
- Parent:
- 0:e260b26ee5fb
- Child:
- 2:eeaee1039d50
ugoita
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yosino_adati | 0:e260b26ee5fb | 1 | #include "bit_set.h" |
| yosino_adati | 0:e260b26ee5fb | 2 | |
| yosino_adati | 1:4b6bf9473b7d | 3 | void bit_ini(char var) |
| yosino_adati | 1:4b6bf9473b7d | 4 | { |
| yosino_adati | 1:4b6bf9473b7d | 5 | var &= 0x00; |
| yosino_adati | 1:4b6bf9473b7d | 6 | } |
| yosino_adati | 0:e260b26ee5fb | 7 | |
| yosino_adati | 1:4b6bf9473b7d | 8 | void bit_set(char var,int cons) |
| yosino_adati | 1:4b6bf9473b7d | 9 | { |
| yosino_adati | 1:4b6bf9473b7d | 10 | var |= 2^cons; |
| yosino_adati | 1:4b6bf9473b7d | 11 | } |
| yosino_adati | 0:e260b26ee5fb | 12 | |
| yosino_adati | 1:4b6bf9473b7d | 13 | void bit_clear(char var,int cons) |
| yosino_adati | 1:4b6bf9473b7d | 14 | { |
| yosino_adati | 1:4b6bf9473b7d | 15 | var &= ~(2^cons); |
| yosino_adati | 1:4b6bf9473b7d | 16 | } |
| yosino_adati | 0:e260b26ee5fb | 17 | |
| yosino_adati | 1:4b6bf9473b7d | 18 | bool bit_check(char var,int cons) |
| yosino_adati | 1:4b6bf9473b7d | 19 | { |
| yosino_adati | 1:4b6bf9473b7d | 20 | return (var &= 2^cons)?true:false; |
| yosino_adati | 1:4b6bf9473b7d | 21 | } |