This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error

Hi.I am using writing a program and keil show me this error:
ov7670.h(18): error: #29: expected an expression
The program:
#ifndef __ov7670_H
#define __ov7670_H

#include <stdio.h>
#include <stdint.h>

#include "ov7670reg.h"

#define OV7670_ADDR 0x42

#define HEIGHT 120

#define WIDTH
uint16_t frame1[ HEIGHT * WIDTH ];
uint16_t frame2[ HEIGHT * WIDTH ];

uint32_t ov7670_set(uint8_t addr,uint8_t val);
uint8_t ov7670_get(uint8_t addr);
void ov7670_init(void);
void ov7670_readframe(void);
void ov7670_clear_buffer(void);
void ov7670_check_missing(void);
The error is from bold part!!!!!!!!
What should i do?
Thanks

Parents
  • What you should do?

    Maybe manually try to expand your defines and see if you can't figure out why the compiler is unhappy?

    #define HEIGHT 120
    
    #define WIDTH                <==== what is this???
    uint16_t frame1[ HEIGHT * WIDTH ];
    uint16_t frame2[ HEIGHT * WIDTH ];
    
    uint16_t frame1[ 120 *  ];  <=== does this look correct to you?
    uint16_t frame2[ 120 *  ];  <=== or this???
    

    Don't be so quick to ask for help - the best help is expected to be installed between your ears.

Reply
  • What you should do?

    Maybe manually try to expand your defines and see if you can't figure out why the compiler is unhappy?

    #define HEIGHT 120
    
    #define WIDTH                <==== what is this???
    uint16_t frame1[ HEIGHT * WIDTH ];
    uint16_t frame2[ HEIGHT * WIDTH ];
    
    uint16_t frame1[ 120 *  ];  <=== does this look correct to you?
    uint16_t frame2[ 120 *  ];  <=== or this???
    

    Don't be so quick to ask for help - the best help is expected to be installed between your ears.

Children
No data