소스 검색

Use constexpr constructor for SerialFlashFile

main
PaulStoffregen 7 년 전
부모
커밋
594d389fde
1개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. +5
    -6
      SerialFlash.h

+ 5
- 6
SerialFlash.h 파일 보기

@@ -76,8 +76,7 @@ extern SerialFlashChip SerialFlash;
class SerialFlashFile
{
public:
SerialFlashFile() : address(0) {
}
constexpr SerialFlashFile() { }
operator bool() {
if (address > 0) return true;
return false;
@@ -123,10 +122,10 @@ public:
}
protected:
friend class SerialFlashChip;
uint32_t address; // where this file's data begins in the Flash, or zero
uint32_t length; // total length of the data in the Flash chip
uint32_t offset; // current read/write offset in the file
uint16_t dirindex;
uint32_t address = 0; // where this file's data begins in the Flash, or zero
uint32_t length = 0; // total length of the data in the Flash chip
uint32_t offset = 0; // current read/write offset in the file
uint16_t dirindex = 0;
};



Loading…
취소
저장