Bladeren bron

Fix hexadecimal number formatting

Scott Lahteine 7 jaren geleden
bovenliggende
commit
75e6f72c89
10 gewijzigde bestanden met toevoegingen van 122 en 122 verwijderingen
  1. 14
    14
      Marlin/Sd2Card.cpp
  2. 11
    11
      Marlin/Sd2Card.h
  3. 7
    7
      Marlin/SdBaseFile.cpp
  4. 13
    13
      Marlin/SdBaseFile.h
  5. 36
    36
      Marlin/SdFatStructs.h
  6. 26
    26
      Marlin/SdInfo.h
  7. 10
    10
      Marlin/SdVolume.cpp
  8. 1
    1
      Marlin/SdVolume.h
  9. 1
    1
      Marlin/pca9632.cpp
  10. 3
    3
      Marlin/softspi.h

+ 14
- 14
Marlin/Sd2Card.cpp Bestand weergeven

55
   //------------------------------------------------------------------------------
55
   //------------------------------------------------------------------------------
56
   /** SPI receive a byte */
56
   /** SPI receive a byte */
57
   static uint8_t spiRec() {
57
   static uint8_t spiRec() {
58
-    SPDR = 0XFF;
58
+    SPDR = 0xFF;
59
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
59
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
60
     return SPDR;
60
     return SPDR;
61
   }
61
   }
64
   static inline __attribute__((always_inline))
64
   static inline __attribute__((always_inline))
65
   void spiRead(uint8_t* buf, uint16_t nbyte) {
65
   void spiRead(uint8_t* buf, uint16_t nbyte) {
66
     if (nbyte-- == 0) return;
66
     if (nbyte-- == 0) return;
67
-    SPDR = 0XFF;
67
+    SPDR = 0xFF;
68
     for (uint16_t i = 0; i < nbyte; i++) {
68
     for (uint16_t i = 0; i < nbyte; i++) {
69
       while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
69
       while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
70
       buf[i] = SPDR;
70
       buf[i] = SPDR;
71
-      SPDR = 0XFF;
71
+      SPDR = 0xFF;
72
     }
72
     }
73
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
73
     while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
74
     buf[nbyte] = SPDR;
74
     buf[nbyte] = SPDR;
103
     uint8_t data = 0;
103
     uint8_t data = 0;
104
     // no interrupts during byte receive - about 8 us
104
     // no interrupts during byte receive - about 8 us
105
     cli();
105
     cli();
106
-    // output pin high - like sending 0XFF
106
+    // output pin high - like sending 0xFF
107
     WRITE(SPI_MOSI_PIN, HIGH);
107
     WRITE(SPI_MOSI_PIN, HIGH);
108
 
108
 
109
     for (uint8_t i = 0; i < 8; i++) {
109
     for (uint8_t i = 0; i < 8; i++) {
137
     for (uint8_t i = 0; i < 8; i++) {
137
     for (uint8_t i = 0; i < 8; i++) {
138
       WRITE(SPI_SCK_PIN, LOW);
138
       WRITE(SPI_SCK_PIN, LOW);
139
 
139
 
140
-      WRITE(SPI_MOSI_PIN, data & 0X80);
140
+      WRITE(SPI_MOSI_PIN, data & 0x80);
141
 
141
 
142
       data <<= 1;
142
       data <<= 1;
143
 
143
 
177
   for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s);
177
   for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s);
178
 
178
 
179
   // send CRC
179
   // send CRC
180
-  uint8_t crc = 0XFF;
181
-  if (cmd == CMD0) crc = 0X95;  // correct crc for CMD0 with arg 0
182
-  if (cmd == CMD8) crc = 0X87;  // correct crc for CMD8 with arg 0X1AA
180
+  uint8_t crc = 0xFF;
181
+  if (cmd == CMD0) crc = 0x95;  // correct crc for CMD0 with arg 0
182
+  if (cmd == CMD8) crc = 0x87;  // correct crc for CMD8 with arg 0x1AA
183
   spiSend(crc);
183
   spiSend(crc);
184
 
184
 
185
   // skip stuff byte for stop read
185
   // skip stuff byte for stop read
186
   if (cmd == CMD12) spiRec();
186
   if (cmd == CMD12) spiRec();
187
 
187
 
188
   // wait for response
188
   // wait for response
189
-  for (uint8_t i = 0; ((status_ = spiRec()) & 0X80) && i != 0XFF; i++) { /* Intentionally left empty */ }
189
+  for (uint8_t i = 0; ((status_ = spiRec()) & 0x80) && i != 0xFF; i++) { /* Intentionally left empty */ }
190
   return status_;
190
   return status_;
191
 }
191
 }
192
 //------------------------------------------------------------------------------
192
 //------------------------------------------------------------------------------
329
   #endif  // SOFTWARE_SPI
329
   #endif  // SOFTWARE_SPI
330
 
330
 
331
   // must supply min of 74 clock cycles with CS high.
331
   // must supply min of 74 clock cycles with CS high.
332
-  for (uint8_t i = 0; i < 10; i++) spiSend(0XFF);
332
+  for (uint8_t i = 0; i < 10; i++) spiSend(0xFF);
333
 
333
 
334
   // command to go idle in SPI mode
334
   // command to go idle in SPI mode
335
   while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) {
335
   while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) {
345
   else {
345
   else {
346
     // only need last byte of r7 response
346
     // only need last byte of r7 response
347
     for (uint8_t i = 0; i < 4; i++) status_ = spiRec();
347
     for (uint8_t i = 0; i < 4; i++) status_ = spiRec();
348
-    if (status_ != 0XAA) {
348
+    if (status_ != 0xAA) {
349
       error(SD_CARD_ERROR_CMD8);
349
       error(SD_CARD_ERROR_CMD8);
350
       goto fail;
350
       goto fail;
351
     }
351
     }
352
     type(SD_CARD_TYPE_SD2);
352
     type(SD_CARD_TYPE_SD2);
353
   }
353
   }
354
   // initialize card and send host supports SDHC if SD2
354
   // initialize card and send host supports SDHC if SD2
355
-  arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0;
355
+  arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0;
356
 
356
 
357
   while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) {
357
   while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) {
358
     // check for timeout
358
     // check for timeout
367
       error(SD_CARD_ERROR_CMD58);
367
       error(SD_CARD_ERROR_CMD58);
368
       goto fail;
368
       goto fail;
369
     }
369
     }
370
-    if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC);
370
+    if ((spiRec() & 0xC0) == 0xC0) type(SD_CARD_TYPE_SDHC);
371
     // discard rest of ocr - contains allowed voltage range
371
     // discard rest of ocr - contains allowed voltage range
372
     for (uint8_t i = 0; i < 3; i++) spiRec();
372
     for (uint8_t i = 0; i < 3; i++) spiRec();
373
   }
373
   }
473
 static uint16_t CRC_CCITT(const uint8_t* data, size_t n) {
473
 static uint16_t CRC_CCITT(const uint8_t* data, size_t n) {
474
   uint16_t crc = 0;
474
   uint16_t crc = 0;
475
   for (size_t i = 0; i < n; i++) {
475
   for (size_t i = 0; i < n; i++) {
476
-    crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0XFF]) ^ (crc << 8);
476
+    crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8);
477
   }
477
   }
478
   return crc;
478
   return crc;
479
 }
479
 }

+ 11
- 11
Marlin/Sd2Card.h Bestand weergeven

92
 /** card returned an error token instead of read data */
92
 /** card returned an error token instead of read data */
93
 uint8_t const SD_CARD_ERROR_READ = 0XF;
93
 uint8_t const SD_CARD_ERROR_READ = 0XF;
94
 /** read CID or CSD failed */
94
 /** read CID or CSD failed */
95
-uint8_t const SD_CARD_ERROR_READ_REG = 0X10;
95
+uint8_t const SD_CARD_ERROR_READ_REG = 0x10;
96
 /** timeout while waiting for start of read data */
96
 /** timeout while waiting for start of read data */
97
-uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X11;
97
+uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0x11;
98
 /** card did not accept STOP_TRAN_TOKEN */
98
 /** card did not accept STOP_TRAN_TOKEN */
99
-uint8_t const SD_CARD_ERROR_STOP_TRAN = 0X12;
99
+uint8_t const SD_CARD_ERROR_STOP_TRAN = 0x12;
100
 /** card returned an error token as a response to a write operation */
100
 /** card returned an error token as a response to a write operation */
101
-uint8_t const SD_CARD_ERROR_WRITE = 0X13;
101
+uint8_t const SD_CARD_ERROR_WRITE = 0x13;
102
 /** attempt to write protected block zero */
102
 /** attempt to write protected block zero */
103
-uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0X14;  // REMOVE - not used
103
+uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0x14;  // REMOVE - not used
104
 /** card did not go ready for a multiple block write */
104
 /** card did not go ready for a multiple block write */
105
-uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0X15;
105
+uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0x15;
106
 /** card returned an error to a CMD13 status check after a write */
106
 /** card returned an error to a CMD13 status check after a write */
107
-uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0X16;
107
+uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0x16;
108
 /** timeout occurred during write programming */
108
 /** timeout occurred during write programming */
109
-uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0X17;
109
+uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0x17;
110
 /** incorrect rate selected */
110
 /** incorrect rate selected */
111
-uint8_t const SD_CARD_ERROR_SCK_RATE = 0X18;
111
+uint8_t const SD_CARD_ERROR_SCK_RATE = 0x18;
112
 /** init() not called */
112
 /** init() not called */
113
-uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0X19;
113
+uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0x19;
114
 /** crc check error */
114
 /** crc check error */
115
-uint8_t const SD_CARD_ERROR_CRC = 0X20;
115
+uint8_t const SD_CARD_ERROR_CRC = 0x20;
116
 //------------------------------------------------------------------------------
116
 //------------------------------------------------------------------------------
117
 // card types
117
 // card types
118
 /** Standard capacity V1 SD card */
118
 /** Standard capacity V1 SD card */

+ 7
- 7
Marlin/SdBaseFile.cpp Bestand weergeven

57
 bool SdBaseFile::addDirCluster() {
57
 bool SdBaseFile::addDirCluster() {
58
   uint32_t block;
58
   uint32_t block;
59
   // max folder size
59
   // max folder size
60
-  if (fileSize_ / sizeof(dir_t) >= 0XFFFF) goto fail;
60
+  if (fileSize_ / sizeof(dir_t) >= 0xFFFF) goto fail;
61
 
61
 
62
   if (!addCluster()) goto fail;
62
   if (!addCluster()) goto fail;
63
   if (!vol_->cacheFlush()) goto fail;
63
   if (!vol_->cacheFlush()) goto fail;
510
     d.firstClusterHigh = 0;
510
     d.firstClusterHigh = 0;
511
   }
511
   }
512
   else {
512
   else {
513
-    d.firstClusterLow = parent->firstCluster_ & 0XFFFF;
513
+    d.firstClusterLow = parent->firstCluster_ & 0xFFFF;
514
     d.firstClusterHigh = parent->firstCluster_ >> 16;
514
     d.firstClusterHigh = parent->firstCluster_ >> 16;
515
   }
515
   }
516
   // copy '..' to block
516
   // copy '..' to block
1063
   // amount left to read
1063
   // amount left to read
1064
   toRead = nbyte;
1064
   toRead = nbyte;
1065
   while (toRead > 0) {
1065
   while (toRead > 0) {
1066
-    offset = curPosition_ & 0X1FF;  // offset in block
1066
+    offset = curPosition_ & 0x1FF;  // offset in block
1067
     if (type_ == FAT_FILE_TYPE_ROOT_FIXED) {
1067
     if (type_ == FAT_FILE_TYPE_ROOT_FIXED) {
1068
       block = vol_->rootDirStart() + (curPosition_ >> 9);
1068
       block = vol_->rootDirStart() + (curPosition_ >> 9);
1069
     }
1069
     }
1120
 int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1120
 int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1121
   int16_t n;
1121
   int16_t n;
1122
   // if not a directory file or miss-positioned return an error
1122
   // if not a directory file or miss-positioned return an error
1123
-  if (!isDir() || (0X1F & curPosition_)) return -1;
1123
+  if (!isDir() || (0x1F & curPosition_)) return -1;
1124
 
1124
 
1125
   //If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly.
1125
   //If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly.
1126
   if (longFilename != NULL) longFilename[0] = '\0';
1126
   if (longFilename != NULL) longFilename[0] = '\0';
1513
     if (!isDir()) d->fileSize = fileSize_;
1513
     if (!isDir()) d->fileSize = fileSize_;
1514
 
1514
 
1515
     // update first cluster fields
1515
     // update first cluster fields
1516
-    d->firstClusterLow = firstCluster_ & 0XFFFF;
1516
+    d->firstClusterLow = firstCluster_ & 0xFFFF;
1517
     d->firstClusterHigh = firstCluster_ >> 16;
1517
     d->firstClusterHigh = firstCluster_ >> 16;
1518
 
1518
 
1519
     // set modify time if user supplied a callback date/time function
1519
     // set modify time if user supplied a callback date/time function
1738
 
1738
 
1739
   while (nToWrite > 0) {
1739
   while (nToWrite > 0) {
1740
     uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_);
1740
     uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_);
1741
-    uint16_t blockOffset = curPosition_ & 0X1FF;
1741
+    uint16_t blockOffset = curPosition_ & 0x1FF;
1742
     if (blockOfCluster == 0 && blockOffset == 0) {
1742
     if (blockOfCluster == 0 && blockOffset == 0) {
1743
       // start of new cluster
1743
       // start of new cluster
1744
       if (curCluster_ == 0) {
1744
       if (curCluster_ == 0) {
1774
       // full block - don't need to use cache
1774
       // full block - don't need to use cache
1775
       if (vol_->cacheBlockNumber() == block) {
1775
       if (vol_->cacheBlockNumber() == block) {
1776
         // invalidate cache if block is in cache
1776
         // invalidate cache if block is in cache
1777
-        vol_->cacheSetBlockNumber(0XFFFFFFFF, false);
1777
+        vol_->cacheSetBlockNumber(0xFFFFFFFF, false);
1778
       }
1778
       }
1779
       if (!vol_->writeBlock(block, src)) goto fail;
1779
       if (!vol_->writeBlock(block, src)) goto fail;
1780
     }
1780
     }

+ 13
- 13
Marlin/SdBaseFile.h Bestand weergeven

54
 
54
 
55
 // use the gnu style oflag in open()
55
 // use the gnu style oflag in open()
56
 /** open() oflag for reading */
56
 /** open() oflag for reading */
57
-uint8_t const O_READ = 0X01;
57
+uint8_t const O_READ = 0x01;
58
 /** open() oflag - same as O_IN */
58
 /** open() oflag - same as O_IN */
59
 uint8_t const O_RDONLY = O_READ;
59
 uint8_t const O_RDONLY = O_READ;
60
 /** open() oflag for write */
60
 /** open() oflag for write */
61
-uint8_t const O_WRITE = 0X02;
61
+uint8_t const O_WRITE = 0x02;
62
 /** open() oflag - same as O_WRITE */
62
 /** open() oflag - same as O_WRITE */
63
 uint8_t const O_WRONLY = O_WRITE;
63
 uint8_t const O_WRONLY = O_WRITE;
64
 /** open() oflag for reading and writing */
64
 /** open() oflag for reading and writing */
66
 /** open() oflag mask for access modes */
66
 /** open() oflag mask for access modes */
67
 uint8_t const O_ACCMODE = (O_READ | O_WRITE);
67
 uint8_t const O_ACCMODE = (O_READ | O_WRITE);
68
 /** The file offset shall be set to the end of the file prior to each write. */
68
 /** The file offset shall be set to the end of the file prior to each write. */
69
-uint8_t const O_APPEND = 0X04;
69
+uint8_t const O_APPEND = 0x04;
70
 /** synchronous writes - call sync() after each write */
70
 /** synchronous writes - call sync() after each write */
71
-uint8_t const O_SYNC = 0X08;
71
+uint8_t const O_SYNC = 0x08;
72
 /** truncate the file to zero length */
72
 /** truncate the file to zero length */
73
-uint8_t const O_TRUNC = 0X10;
73
+uint8_t const O_TRUNC = 0x10;
74
 /** set the initial position at the end of the file */
74
 /** set the initial position at the end of the file */
75
-uint8_t const O_AT_END = 0X20;
75
+uint8_t const O_AT_END = 0x20;
76
 /** create the file if nonexistent */
76
 /** create the file if nonexistent */
77
-uint8_t const O_CREAT = 0X40;
77
+uint8_t const O_CREAT = 0x40;
78
 /** If O_CREAT and O_EXCL are set, open() shall fail if the file exists */
78
 /** If O_CREAT and O_EXCL are set, open() shall fail if the file exists */
79
-uint8_t const O_EXCL = 0X80;
79
+uint8_t const O_EXCL = 0x80;
80
 
80
 
81
 // SdBaseFile class static and const definitions
81
 // SdBaseFile class static and const definitions
82
 // flags for ls()
82
 // flags for ls()
141
  * \return Extracted day [1,31]
141
  * \return Extracted day [1,31]
142
  */
142
  */
143
 static inline uint8_t FAT_DAY(uint16_t fatDate) {
143
 static inline uint8_t FAT_DAY(uint16_t fatDate) {
144
-  return fatDate & 0X1F;
144
+  return fatDate & 0x1F;
145
 }
145
 }
146
 /** time field for FAT directory entry
146
 /** time field for FAT directory entry
147
  * \param[in] hour [0,23]
147
  * \param[in] hour [0,23]
167
  * \return Extracted minute [0,59]
167
  * \return Extracted minute [0,59]
168
  */
168
  */
169
 static inline uint8_t FAT_MINUTE(uint16_t fatTime) {
169
 static inline uint8_t FAT_MINUTE(uint16_t fatTime) {
170
-  return (fatTime >> 5) & 0X3F;
170
+  return (fatTime >> 5) & 0x3F;
171
 }
171
 }
172
 /** second part of FAT directory time field
172
 /** second part of FAT directory time field
173
  * Note second/2 is stored in packed time.
173
  * Note second/2 is stored in packed time.
177
  * \return Extracted second [0,58]
177
  * \return Extracted second [0,58]
178
  */
178
  */
179
 static inline uint8_t FAT_SECOND(uint16_t fatTime) {
179
 static inline uint8_t FAT_SECOND(uint16_t fatTime) {
180
-  return 2 * (fatTime & 0X1F);
180
+  return 2 * (fatTime & 0x1F);
181
 }
181
 }
182
 /** Default date for file timestamps is 1 Jan 2000 */
182
 /** Default date for file timestamps is 1 Jan 2000 */
183
 uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1;
183
 uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1;
338
   // data time callback function
338
   // data time callback function
339
   static void (*dateTime_)(uint16_t* date, uint16_t* time);
339
   static void (*dateTime_)(uint16_t* date, uint16_t* time);
340
   // bits defined in flags_
340
   // bits defined in flags_
341
-  // should be 0X0F
341
+  // should be 0x0F
342
   static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC);
342
   static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC);
343
   // sync of directory entry required
343
   // sync of directory entry required
344
-  static uint8_t const F_FILE_DIR_DIRTY = 0X80;
344
+  static uint8_t const F_FILE_DIR_DIRTY = 0x80;
345
 
345
 
346
   // private data
346
   // private data
347
   uint8_t   flags_;         // See above for definition of flags_ bits
347
   uint8_t   flags_;         // See above for definition of flags_ bits

+ 36
- 36
Marlin/SdFatStructs.h Bestand weergeven

43
  */
43
  */
44
 //------------------------------------------------------------------------------
44
 //------------------------------------------------------------------------------
45
 /** Value for byte 510 of boot block or MBR */
45
 /** Value for byte 510 of boot block or MBR */
46
-uint8_t const BOOTSIG0 = 0X55;
46
+uint8_t const BOOTSIG0 = 0x55;
47
 /** Value for byte 511 of boot block or MBR */
47
 /** Value for byte 511 of boot block or MBR */
48
-uint8_t const BOOTSIG1 = 0XAA;
48
+uint8_t const BOOTSIG1 = 0xAA;
49
 /** Value for bootSignature field int FAT/FAT32 boot sector */
49
 /** Value for bootSignature field int FAT/FAT32 boot sector */
50
-uint8_t const EXTENDED_BOOT_SIG = 0X29;
50
+uint8_t const EXTENDED_BOOT_SIG = 0x29;
51
 //------------------------------------------------------------------------------
51
 //------------------------------------------------------------------------------
52
 /**
52
 /**
53
  * \struct partitionTable
53
  * \struct partitionTable
59
 struct partitionTable {
59
 struct partitionTable {
60
           /**
60
           /**
61
            * Boot Indicator . Indicates whether the volume is the active
61
            * Boot Indicator . Indicates whether the volume is the active
62
-           * partition.  Legal values include: 0X00. Do not use for booting.
63
-           * 0X80 Active partition.
62
+           * partition.  Legal values include: 0x00. Do not use for booting.
63
+           * 0x80 Active partition.
64
            */
64
            */
65
   uint8_t  boot;
65
   uint8_t  boot;
66
           /**
66
           /**
126
   uint16_t usuallyZero;
126
   uint16_t usuallyZero;
127
            /** Partition tables. */
127
            /** Partition tables. */
128
   part_t   part[4];
128
   part_t   part[4];
129
-           /** First MBR signature byte. Must be 0X55 */
129
+           /** First MBR signature byte. Must be 0x55 */
130
   uint8_t  mbrSig0;
130
   uint8_t  mbrSig0;
131
-           /** Second MBR signature byte. Must be 0XAA */
131
+           /** Second MBR signature byte. Must be 0xAA */
132
   uint8_t  mbrSig1;
132
   uint8_t  mbrSig1;
133
 } PACKED;
133
 } PACKED;
134
 /** Type name for masterBootRecord */
134
 /** Type name for masterBootRecord */
234
   uint8_t  driveNumber;
234
   uint8_t  driveNumber;
235
            /** used by Windows NT - should be zero for FAT */
235
            /** used by Windows NT - should be zero for FAT */
236
   uint8_t  reserved1;
236
   uint8_t  reserved1;
237
-           /** 0X29 if next three fields are valid */
237
+           /** 0x29 if next three fields are valid */
238
   uint8_t  bootSignature;
238
   uint8_t  bootSignature;
239
            /**
239
            /**
240
             * A random serial number created when formatting a disk,
240
             * A random serial number created when formatting a disk,
254
   char     fileSystemType[8];
254
   char     fileSystemType[8];
255
            /** X86 boot code */
255
            /** X86 boot code */
256
   uint8_t  bootCode[448];
256
   uint8_t  bootCode[448];
257
-           /** must be 0X55 */
257
+           /** must be 0x55 */
258
   uint8_t  bootSectorSig0;
258
   uint8_t  bootSectorSig0;
259
-           /** must be 0XAA */
259
+           /** must be 0xAA */
260
   uint8_t  bootSectorSig1;
260
   uint8_t  bootSectorSig1;
261
 } PACKED;
261
 } PACKED;
262
 /** Type name for FAT Boot Sector */
262
 /** Type name for FAT Boot Sector */
389
   uint8_t  driveNumber;
389
   uint8_t  driveNumber;
390
            /** used by Windows NT - should be zero for FAT */
390
            /** used by Windows NT - should be zero for FAT */
391
   uint8_t  reserved1;
391
   uint8_t  reserved1;
392
-           /** 0X29 if next three fields are valid */
392
+           /** 0x29 if next three fields are valid */
393
   uint8_t  bootSignature;
393
   uint8_t  bootSignature;
394
            /**
394
            /**
395
             * A random serial number created when formatting a disk,
395
             * A random serial number created when formatting a disk,
408
   char     fileSystemType[8];
408
   char     fileSystemType[8];
409
            /** X86 boot code */
409
            /** X86 boot code */
410
   uint8_t  bootCode[420];
410
   uint8_t  bootCode[420];
411
-           /** must be 0X55 */
411
+           /** must be 0x55 */
412
   uint8_t  bootSectorSig0;
412
   uint8_t  bootSectorSig0;
413
-           /** must be 0XAA */
413
+           /** must be 0xAA */
414
   uint8_t  bootSectorSig1;
414
   uint8_t  bootSectorSig1;
415
 } PACKED;
415
 } PACKED;
416
 /** Type name for FAT32 Boot Sector */
416
 /** Type name for FAT32 Boot Sector */
427
  *
427
  *
428
  */
428
  */
429
 struct fat32_fsinfo {
429
 struct fat32_fsinfo {
430
-           /** must be 0X52, 0X52, 0X61, 0X41 */
430
+           /** must be 0x52, 0x52, 0x61, 0x41 */
431
   uint32_t  leadSignature;
431
   uint32_t  leadSignature;
432
            /** must be zero */
432
            /** must be zero */
433
   uint8_t  reserved1[480];
433
   uint8_t  reserved1[480];
434
-           /** must be 0X72, 0X72, 0X41, 0X61 */
434
+           /** must be 0x72, 0x72, 0x41, 0x61 */
435
   uint32_t  structSignature;
435
   uint32_t  structSignature;
436
           /**
436
           /**
437
            * Contains the last known free cluster count on the volume.
437
            * Contains the last known free cluster count on the volume.
450
   uint32_t nextFree;
450
   uint32_t nextFree;
451
            /** must be zero */
451
            /** must be zero */
452
   uint8_t  reserved2[12];
452
   uint8_t  reserved2[12];
453
-           /** must be 0X00, 0X00, 0X55, 0XAA */
453
+           /** must be 0x00, 0x00, 0x55, 0xAA */
454
   uint8_t  tailSignature[4];
454
   uint8_t  tailSignature[4];
455
 } PACKED;
455
 } PACKED;
456
 /** Type name for FAT32 FSINFO Sector */
456
 /** Type name for FAT32 FSINFO Sector */
458
 //------------------------------------------------------------------------------
458
 //------------------------------------------------------------------------------
459
 // End Of Chain values for FAT entries
459
 // End Of Chain values for FAT entries
460
 /** FAT12 end of chain value used by Microsoft. */
460
 /** FAT12 end of chain value used by Microsoft. */
461
-uint16_t const FAT12EOC = 0XFFF;
461
+uint16_t const FAT12EOC = 0xFFF;
462
 /** Minimum value for FAT12 EOC.  Use to test for EOC. */
462
 /** Minimum value for FAT12 EOC.  Use to test for EOC. */
463
-uint16_t const FAT12EOC_MIN = 0XFF8;
463
+uint16_t const FAT12EOC_MIN = 0xFF8;
464
 /** FAT16 end of chain value used by Microsoft. */
464
 /** FAT16 end of chain value used by Microsoft. */
465
-uint16_t const FAT16EOC = 0XFFFF;
465
+uint16_t const FAT16EOC = 0xFFFF;
466
 /** Minimum value for FAT16 EOC.  Use to test for EOC. */
466
 /** Minimum value for FAT16 EOC.  Use to test for EOC. */
467
-uint16_t const FAT16EOC_MIN = 0XFFF8;
467
+uint16_t const FAT16EOC_MIN = 0xFFF8;
468
 /** FAT32 end of chain value used by Microsoft. */
468
 /** FAT32 end of chain value used by Microsoft. */
469
-uint32_t const FAT32EOC = 0X0FFFFFFF;
469
+uint32_t const FAT32EOC = 0x0FFFFFFF;
470
 /** Minimum value for FAT32 EOC.  Use to test for EOC. */
470
 /** Minimum value for FAT32 EOC.  Use to test for EOC. */
471
-uint32_t const FAT32EOC_MIN = 0X0FFFFFF8;
471
+uint32_t const FAT32EOC_MIN = 0x0FFFFFF8;
472
 /** Mask a for FAT32 entry. Entries are 28 bits. */
472
 /** Mask a for FAT32 entry. Entries are 28 bits. */
473
-uint32_t const FAT32MASK = 0X0FFFFFFF;
473
+uint32_t const FAT32MASK = 0x0FFFFFFF;
474
 //------------------------------------------------------------------------------
474
 //------------------------------------------------------------------------------
475
 /**
475
 /**
476
  * \struct directoryEntry
476
  * \struct directoryEntry
590
 typedef struct directoryEntry dir_t;
590
 typedef struct directoryEntry dir_t;
591
 /** Type name for directoryVFATEntry */
591
 /** Type name for directoryVFATEntry */
592
 typedef struct directoryVFATEntry vfat_t;
592
 typedef struct directoryVFATEntry vfat_t;
593
-/** escape for name[0] = 0XE5 */
594
-uint8_t const DIR_NAME_0XE5 = 0X05;
593
+/** escape for name[0] = 0xE5 */
594
+uint8_t const DIR_NAME_0xE5 = 0x05;
595
 /** name[0] value for entry that is free after being "deleted" */
595
 /** name[0] value for entry that is free after being "deleted" */
596
-uint8_t const DIR_NAME_DELETED = 0XE5;
596
+uint8_t const DIR_NAME_DELETED = 0xE5;
597
 /** name[0] value for entry that is free and no allocated entries follow */
597
 /** name[0] value for entry that is free and no allocated entries follow */
598
-uint8_t const DIR_NAME_FREE = 0X00;
598
+uint8_t const DIR_NAME_FREE = 0x00;
599
 /** file is read-only */
599
 /** file is read-only */
600
-uint8_t const DIR_ATT_READ_ONLY = 0X01;
600
+uint8_t const DIR_ATT_READ_ONLY = 0x01;
601
 /** File should hidden in directory listings */
601
 /** File should hidden in directory listings */
602
-uint8_t const DIR_ATT_HIDDEN = 0X02;
602
+uint8_t const DIR_ATT_HIDDEN = 0x02;
603
 /** Entry is for a system file */
603
 /** Entry is for a system file */
604
-uint8_t const DIR_ATT_SYSTEM = 0X04;
604
+uint8_t const DIR_ATT_SYSTEM = 0x04;
605
 /** Directory entry contains the volume label */
605
 /** Directory entry contains the volume label */
606
-uint8_t const DIR_ATT_VOLUME_ID = 0X08;
606
+uint8_t const DIR_ATT_VOLUME_ID = 0x08;
607
 /** Entry is for a directory */
607
 /** Entry is for a directory */
608
-uint8_t const DIR_ATT_DIRECTORY = 0X10;
608
+uint8_t const DIR_ATT_DIRECTORY = 0x10;
609
 /** Old DOS archive bit for backup support */
609
 /** Old DOS archive bit for backup support */
610
-uint8_t const DIR_ATT_ARCHIVE = 0X20;
610
+uint8_t const DIR_ATT_ARCHIVE = 0x20;
611
 /** Test value for long name entry.  Test is
611
 /** Test value for long name entry.  Test is
612
   (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. */
612
   (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. */
613
-uint8_t const DIR_ATT_LONG_NAME = 0X0F;
613
+uint8_t const DIR_ATT_LONG_NAME = 0x0F;
614
 /** Test mask for long name entry */
614
 /** Test mask for long name entry */
615
-uint8_t const DIR_ATT_LONG_NAME_MASK = 0X3F;
615
+uint8_t const DIR_ATT_LONG_NAME_MASK = 0x3F;
616
 /** defined attribute bits */
616
 /** defined attribute bits */
617
-uint8_t const DIR_ATT_DEFINED_BITS = 0X3F;
617
+uint8_t const DIR_ATT_DEFINED_BITS = 0x3F;
618
 /** Directory entry is part of a long name
618
 /** Directory entry is part of a long name
619
  * \param[in] dir Pointer to a directory entry.
619
  * \param[in] dir Pointer to a directory entry.
620
  *
620
  *

+ 26
- 26
Marlin/SdInfo.h Bestand weergeven

45
 //------------------------------------------------------------------------------
45
 //------------------------------------------------------------------------------
46
 // SD card commands
46
 // SD card commands
47
 /** GO_IDLE_STATE - init card in spi mode if CS low */
47
 /** GO_IDLE_STATE - init card in spi mode if CS low */
48
-uint8_t const CMD0 = 0X00;
48
+uint8_t const CMD0 = 0x00;
49
 /** SEND_IF_COND - verify SD Memory Card interface operating condition.*/
49
 /** SEND_IF_COND - verify SD Memory Card interface operating condition.*/
50
-uint8_t const CMD8 = 0X08;
50
+uint8_t const CMD8 = 0x08;
51
 /** SEND_CSD - read the Card Specific Data (CSD register) */
51
 /** SEND_CSD - read the Card Specific Data (CSD register) */
52
-uint8_t const CMD9 = 0X09;
52
+uint8_t const CMD9 = 0x09;
53
 /** SEND_CID - read the card identification information (CID register) */
53
 /** SEND_CID - read the card identification information (CID register) */
54
-uint8_t const CMD10 = 0X0A;
54
+uint8_t const CMD10 = 0x0A;
55
 /** STOP_TRANSMISSION - end multiple block read sequence */
55
 /** STOP_TRANSMISSION - end multiple block read sequence */
56
-uint8_t const CMD12 = 0X0C;
56
+uint8_t const CMD12 = 0x0C;
57
 /** SEND_STATUS - read the card status register */
57
 /** SEND_STATUS - read the card status register */
58
-uint8_t const CMD13 = 0X0D;
58
+uint8_t const CMD13 = 0x0D;
59
 /** READ_SINGLE_BLOCK - read a single data block from the card */
59
 /** READ_SINGLE_BLOCK - read a single data block from the card */
60
-uint8_t const CMD17 = 0X11;
60
+uint8_t const CMD17 = 0x11;
61
 /** READ_MULTIPLE_BLOCK - read a multiple data blocks from the card */
61
 /** READ_MULTIPLE_BLOCK - read a multiple data blocks from the card */
62
-uint8_t const CMD18 = 0X12;
62
+uint8_t const CMD18 = 0x12;
63
 /** WRITE_BLOCK - write a single data block to the card */
63
 /** WRITE_BLOCK - write a single data block to the card */
64
-uint8_t const CMD24 = 0X18;
64
+uint8_t const CMD24 = 0x18;
65
 /** WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION */
65
 /** WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION */
66
-uint8_t const CMD25 = 0X19;
66
+uint8_t const CMD25 = 0x19;
67
 /** ERASE_WR_BLK_START - sets the address of the first block to be erased */
67
 /** ERASE_WR_BLK_START - sets the address of the first block to be erased */
68
-uint8_t const CMD32 = 0X20;
68
+uint8_t const CMD32 = 0x20;
69
 /** ERASE_WR_BLK_END - sets the address of the last block of the continuous
69
 /** ERASE_WR_BLK_END - sets the address of the last block of the continuous
70
     range to be erased*/
70
     range to be erased*/
71
-uint8_t const CMD33 = 0X21;
71
+uint8_t const CMD33 = 0x21;
72
 /** ERASE - erase all previously selected blocks */
72
 /** ERASE - erase all previously selected blocks */
73
-uint8_t const CMD38 = 0X26;
73
+uint8_t const CMD38 = 0x26;
74
 /** APP_CMD - escape for application specific command */
74
 /** APP_CMD - escape for application specific command */
75
-uint8_t const CMD55 = 0X37;
75
+uint8_t const CMD55 = 0x37;
76
 /** READ_OCR - read the OCR register of a card */
76
 /** READ_OCR - read the OCR register of a card */
77
-uint8_t const CMD58 = 0X3A;
77
+uint8_t const CMD58 = 0x3A;
78
 /** SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be
78
 /** SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be
79
      pre-erased before writing */
79
      pre-erased before writing */
80
-uint8_t const ACMD23 = 0X17;
80
+uint8_t const ACMD23 = 0x17;
81
 /** SD_SEND_OP_COMD - Sends host capacity support information and
81
 /** SD_SEND_OP_COMD - Sends host capacity support information and
82
     activates the card's initialization process */
82
     activates the card's initialization process */
83
-uint8_t const ACMD41 = 0X29;
83
+uint8_t const ACMD41 = 0x29;
84
 //------------------------------------------------------------------------------
84
 //------------------------------------------------------------------------------
85
 /** status for card in the ready state */
85
 /** status for card in the ready state */
86
-uint8_t const R1_READY_STATE = 0X00;
86
+uint8_t const R1_READY_STATE = 0x00;
87
 /** status for card in the idle state */
87
 /** status for card in the idle state */
88
-uint8_t const R1_IDLE_STATE = 0X01;
88
+uint8_t const R1_IDLE_STATE = 0x01;
89
 /** status bit for illegal command */
89
 /** status bit for illegal command */
90
-uint8_t const R1_ILLEGAL_COMMAND = 0X04;
90
+uint8_t const R1_ILLEGAL_COMMAND = 0x04;
91
 /** start data token for read or write single block*/
91
 /** start data token for read or write single block*/
92
-uint8_t const DATA_START_BLOCK = 0XFE;
92
+uint8_t const DATA_START_BLOCK = 0xFE;
93
 /** stop token for write multiple blocks*/
93
 /** stop token for write multiple blocks*/
94
-uint8_t const STOP_TRAN_TOKEN = 0XFD;
94
+uint8_t const STOP_TRAN_TOKEN = 0xFD;
95
 /** start data token for write multiple blocks*/
95
 /** start data token for write multiple blocks*/
96
-uint8_t const WRITE_MULTIPLE_TOKEN = 0XFC;
96
+uint8_t const WRITE_MULTIPLE_TOKEN = 0xFC;
97
 /** mask for data response tokens after a write block operation */
97
 /** mask for data response tokens after a write block operation */
98
-uint8_t const DATA_RES_MASK = 0X1F;
98
+uint8_t const DATA_RES_MASK = 0x1F;
99
 /** write data accepted token */
99
 /** write data accepted token */
100
-uint8_t const DATA_RES_ACCEPTED = 0X05;
100
+uint8_t const DATA_RES_ACCEPTED = 0x05;
101
 //------------------------------------------------------------------------------
101
 //------------------------------------------------------------------------------
102
 /** Card IDentification (CID) register */
102
 /** Card IDentification (CID) register */
103
 typedef struct CID {
103
 typedef struct CID {
203
   unsigned char reserved1 : 6;
203
   unsigned char reserved1 : 6;
204
   unsigned char csd_ver : 2;
204
   unsigned char csd_ver : 2;
205
   // byte 1
205
   // byte 1
206
-  /** fixed to 0X0E */
206
+  /** fixed to 0x0E */
207
   unsigned char taac;
207
   unsigned char taac;
208
   // byte 2
208
   // byte 2
209
   /** fixed to 0 */
209
   /** fixed to 0 */

+ 10
- 10
Marlin/SdVolume.cpp Bestand weergeven

167
     index += index >> 1;
167
     index += index >> 1;
168
     lba = fatStartBlock_ + (index >> 9);
168
     lba = fatStartBlock_ + (index >> 9);
169
     if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail;
169
     if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail;
170
-    index &= 0X1FF;
170
+    index &= 0x1FF;
171
     uint16_t tmp = cacheBuffer_.data[index];
171
     uint16_t tmp = cacheBuffer_.data[index];
172
     index++;
172
     index++;
173
     if (index == 512) {
173
     if (index == 512) {
175
       index = 0;
175
       index = 0;
176
     }
176
     }
177
     tmp |= cacheBuffer_.data[index] << 8;
177
     tmp |= cacheBuffer_.data[index] << 8;
178
-    *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF;
178
+    *value = cluster & 1 ? tmp >> 4 : tmp & 0xFFF;
179
     return true;
179
     return true;
180
   }
180
   }
181
   if (fatType_ == 16) {
181
   if (fatType_ == 16) {
191
     if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail;
191
     if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail;
192
   }
192
   }
193
   if (fatType_ == 16) {
193
   if (fatType_ == 16) {
194
-    *value = cacheBuffer_.fat16[cluster & 0XFF];
194
+    *value = cacheBuffer_.fat16[cluster & 0xFF];
195
   }
195
   }
196
   else {
196
   else {
197
-    *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK;
197
+    *value = cacheBuffer_.fat32[cluster & 0x7F] & FAT32MASK;
198
   }
198
   }
199
   return true;
199
   return true;
200
 fail:
200
 fail:
217
     if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
217
     if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
218
     // mirror second FAT
218
     // mirror second FAT
219
     if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
219
     if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
220
-    index &= 0X1FF;
220
+    index &= 0x1FF;
221
     uint8_t tmp = value;
221
     uint8_t tmp = value;
222
     if (cluster & 1) {
222
     if (cluster & 1) {
223
       tmp = (cacheBuffer_.data[index] & 0XF) | tmp << 4;
223
       tmp = (cacheBuffer_.data[index] & 0XF) | tmp << 4;
233
     }
233
     }
234
     tmp = value >> 4;
234
     tmp = value >> 4;
235
     if (!(cluster & 1)) {
235
     if (!(cluster & 1)) {
236
-      tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4;
236
+      tmp = ((cacheBuffer_.data[index] & 0xF0)) | tmp >> 4;
237
     }
237
     }
238
     cacheBuffer_.data[index] = tmp;
238
     cacheBuffer_.data[index] = tmp;
239
     return true;
239
     return true;
250
   if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
250
   if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
251
   // store entry
251
   // store entry
252
   if (fatType_ == 16) {
252
   if (fatType_ == 16) {
253
-    cacheBuffer_.fat16[cluster & 0XFF] = value;
253
+    cacheBuffer_.fat16[cluster & 0xFF] = value;
254
   }
254
   }
255
   else {
255
   else {
256
-    cacheBuffer_.fat32[cluster & 0X7F] = value;
256
+    cacheBuffer_.fat32[cluster & 0x7F] = value;
257
   }
257
   }
258
   // mirror second FAT
258
   // mirror second FAT
259
   if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
259
   if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
344
   allocSearchStart_ = 2;
344
   allocSearchStart_ = 2;
345
   cacheDirty_ = 0;  // cacheFlush() will write block if true
345
   cacheDirty_ = 0;  // cacheFlush() will write block if true
346
   cacheMirrorBlock_ = 0;
346
   cacheMirrorBlock_ = 0;
347
-  cacheBlockNumber_ = 0XFFFFFFFF;
347
+  cacheBlockNumber_ = 0xFFFFFFFF;
348
 
348
 
349
   // if part == 0 assume super floppy with FAT boot sector in block zero
349
   // if part == 0 assume super floppy with FAT boot sector in block zero
350
   // if part > 0 assume mbr volume with partition table
350
   // if part > 0 assume mbr volume with partition table
352
     if (part > 4)goto fail;
352
     if (part > 4)goto fail;
353
     if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail;
353
     if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail;
354
     part_t* p = &cacheBuffer_.mbr.part[part - 1];
354
     part_t* p = &cacheBuffer_.mbr.part[part - 1];
355
-    if ((p->boot & 0X7F) != 0  ||
355
+    if ((p->boot & 0x7F) != 0  ||
356
         p->totalSectors < 100 ||
356
         p->totalSectors < 100 ||
357
         p->firstSector == 0) {
357
         p->firstSector == 0) {
358
       // not a valid partition
358
       // not a valid partition

+ 1
- 1
Marlin/SdVolume.h Bestand weergeven

76
    */
76
    */
77
   cache_t* cacheClear() {
77
   cache_t* cacheClear() {
78
     if (!cacheFlush()) return 0;
78
     if (!cacheFlush()) return 0;
79
-    cacheBlockNumber_ = 0XFFFFFFFF;
79
+    cacheBlockNumber_ = 0xFFFFFFFF;
80
     return &cacheBuffer_;
80
     return &cacheBuffer_;
81
   }
81
   }
82
   /** Initialize a FAT volume.  Try partition one first then try super
82
   /** Initialize a FAT volume.  Try partition one first then try super

+ 1
- 1
Marlin/pca9632.cpp Bestand weergeven

45
 #define PCA9632_PWM3        0x05
45
 #define PCA9632_PWM3        0x05
46
 #define PCA9632_GRPPWM      0x06
46
 #define PCA9632_GRPPWM      0x06
47
 #define PCA9632_GRPFREQ     0x07
47
 #define PCA9632_GRPFREQ     0x07
48
-#define PCA9632_LEDOUT      0X08
48
+#define PCA9632_LEDOUT      0x08
49
 #define PCA9632_SUBADR1     0x09
49
 #define PCA9632_SUBADR1     0x09
50
 #define PCA9632_SUBADR2     0x0A
50
 #define PCA9632_SUBADR2     0x0A
51
 #define PCA9632_SUBADR3     0x0B
51
 #define PCA9632_SUBADR3     0x0B

+ 3
- 3
Marlin/softspi.h Bestand weergeven

455
 static inline __attribute__((always_inline))
455
 static inline __attribute__((always_inline))
456
 void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) {
456
 void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) {
457
   uint8_t oldSREG;
457
   uint8_t oldSREG;
458
-  if (address > (uint8_t*)0X5F) {
458
+  if (address > (uint8_t*)0x5F) {
459
     oldSREG = SREG;
459
     oldSREG = SREG;
460
     cli();
460
     cli();
461
   }
461
   }
464
   } else {
464
   } else {
465
     *address &= ~(1 << bit);
465
     *address &= ~(1 << bit);
466
   }
466
   }
467
-  if (address > (uint8_t*)0X5F) {
467
+  if (address > (uint8_t*)0x5F) {
468
     SREG = oldSREG;
468
     SREG = oldSREG;
469
   }
469
   }
470
 }
470
 }
488
 static inline __attribute__((always_inline))
488
 static inline __attribute__((always_inline))
489
 void fastDigitalToggle(uint8_t pin) {
489
 void fastDigitalToggle(uint8_t pin) {
490
   badPinCheck(pin);
490
   badPinCheck(pin);
491
-    if (pinMap[pin].pin > (uint8_t*)0X5F) {
491
+    if (pinMap[pin].pin > (uint8_t*)0x5F) {
492
       // must write bit to high address port
492
       // must write bit to high address port
493
       *pinMap[pin].pin = 1 << pinMap[pin].bit;
493
       *pinMap[pin].pin = 1 << pinMap[pin].bit;
494
     } else {
494
     } else {

Laden…
Annuleren
Opslaan