Skip to content

Commit

Permalink
enum members reordered
Browse files Browse the repository at this point in the history
  • Loading branch information
FT9R committed Mar 27, 2024
1 parent 9caec43 commit c3ebb73
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions w25qxx/w25qxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void w25qxx_Read(w25qxx_HandleTypeDef *w25qxx_Handle, uint8_t *buf, uint16_t dat
W25QXX_ERROR_SET(W25QXX_ERROR_ADDRESS);

/* Command */
w25qxx_Handle->CMD = fastRead ? W25QXX_CMD_FAST_READ : W25QXX_CMD_READ_DATA;
w25qxx_Handle->CMD = (fastRead == W25QXX_FASTREAD) ? W25QXX_CMD_FAST_READ : W25QXX_CMD_READ_DATA;
w25qxx_Handle->interface.CS_Set(W25QXX_CS_LOW);
W25QXX_BEGIN_TRASMIT(&w25qxx_Handle->CMD, sizeof(w25qxx_Handle->CMD), W25QXX_TX_TIMEOUT);

Expand All @@ -230,7 +230,7 @@ void w25qxx_Read(w25qxx_HandleTypeDef *w25qxx_Handle, uint8_t *buf, uint16_t dat
W25QXX_BEGIN_TRASMIT(w25qxx_Handle->addressBytes, sizeof(w25qxx_Handle->addressBytes), W25QXX_TX_TIMEOUT);

/* 8 dummy clocks */
if (fastRead)
if (fastRead == W25QXX_FASTREAD)
W25QXX_BEGIN_TRASMIT(&w25qxx_Handle->CMD, sizeof(w25qxx_Handle->CMD), W25QXX_TX_TIMEOUT);

/* Data receive */
Expand Down Expand Up @@ -505,7 +505,7 @@ void w25qxx_WriteStatus(w25qxx_HandleTypeDef *w25qxx_Handle, uint8_t statusRegis
w25qxx_Handle->interface.CS_Set(W25QXX_CS_HIGH);

/* Task wait */
if (statusRegisterBehaviour == W25QXX_SR_NONVOLATILE)
if (statusRegisterBehaviour != W25QXX_SR_VOLATILE)
{
if (w25qxx_WaitWithTimeout(w25qxx_Handle, W25QXX_WRITE_STATUS_REGISTER_TIME) != W25QXX_STATUS_READY)
W25QXX_ERROR_SET(W25QXX_ERROR_TIMEOUT);
Expand Down
6 changes: 3 additions & 3 deletions w25qxx/w25qxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ enum w25qxx_Device_e { W25Q80 = 0x13, W25Q16, W25Q32, W25Q64, W25Q128 };
/* Data types */
typedef enum w25qxx_WaitForTask_e { W25QXX_WAIT_NO, W25QXX_WAIT_DELAY, W25QXX_WAIT_BUSY } w25qxx_WaitForTask_t;

typedef enum w25qxx_CRC_e { W25QXX_CRC, W25QXX_CRC_NO } w25qxx_CRC_t;
typedef enum w25qxx_CRC_e { W25QXX_CRC_NO, W25QXX_CRC } w25qxx_CRC_t;

typedef enum w25qxx_FastRead_e { W25QXX_FASTREAD, W25QXX_FASTREAD_NO } w25qxx_FastRead_t;
typedef enum w25qxx_FastRead_e { W25QXX_FASTREAD_NO, W25QXX_FASTREAD } w25qxx_FastRead_t;

typedef enum w25qxx_SR_Behaviour_e { W25QXX_SR_VOLATILE, W25QXX_SR_NONVOLATILE } w25qxx_SR_Behaviour_t;
typedef enum w25qxx_SR_Behaviour_e { W25QXX_SR_NONVOLATILE, W25QXX_SR_VOLATILE } w25qxx_SR_Behaviour_t;

typedef enum w25qxx_EraseInstruction_e {
W25QXX_SECTOR_ERASE_4KB,
Expand Down
2 changes: 1 addition & 1 deletion w25qxx/w25qxx_Demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "w25qxx.h"

#define DEMO_TARGET_PAGE 15
#define DEMO_TARGET_PAGE 31

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit c3ebb73

Please sign in to comment.