/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Can't build tutorial

Username:     
Password:     
             

Forum

# 1   2010-12-13 09:37:38 Can't build tutorial

Reckan
New member
Registered: 2010-12-13
Posts: 6

Can't build tutorial

Hi all!

Im completely new to primer2 and ride7 (and to this forum). Im working my way through the "Circle-OS Tutorial for STM32-Primer2" and im having problems! (already yikes)

Im on 3.2 where im going to write a code that simply draws a square on the LCD. Maybe its me who's being really really stupid, dont know yet but hopefully not! this is problem:

Im trying to build this code:

Code:

/********************** (C) COPYRIGHT 2007-2009 RAISONANCE ********************
* File Name          :  Step1.c
* Author             :
* Date First Issued  :
* Description        :  Circle_App CircleOS application template.
* Revision           :
*******************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "circle_api.h"

/* Private defines -----------------------------------------------------------*/

// The following should be the minimal CircleOS version needed by your application
#define NEEDEDVERSION "V 3.7"

/* Private functions ---------------------------------------------------------*/
static enum MENU_code MsgVersion(void);

/* Public variables ----------------------------------------------------------*/
const char Application_Name[8+1] = {"Fredriks"};      // Max 8 characters

#define SQUARE_WIDTH 32
int x = ( SCREEN_WIDTH - SQUARE_WIDTH ) / 2;
int y = ( SCREEN_HEIGHT - SQUARE_WIDTH ) / 2;

/*******************************************************************************
* Function Name  : Application_Ini
* Description    : Initialization function of Circle_App. This function will
*                  be called only once by CircleOS.
* Input          : None
* Return         : MENU_CONTINUE_COMMAND
*******************************************************************************/
enum MENU_code Application_Ini(void)
    {
    // Ensure that the current OS version is recent enough
    if(strcmp(UTIL_GetVersion(), NEEDEDVERSION) < 0)
        {
        return MsgVersion();
        }


    //draw my square
    LCD_DrawRect( x, y, SQUARE_WIDHT, SQUARE_WIDTH, RGB_BLUE);
    LCD_FillRect( x+1, y+1, SQUARE_WIDTH-2, SQUARE_WIDTH-2, RGB_YELLOW);

    return MENU_CONTINUE_COMMAND;
    }

/*******************************************************************************
* Function Name  : Application_Handler
* Description    : Management of the Circle_App.
*
* Input          : None
* Return         : MENU_CONTINUE
*******************************************************************************/
enum MENU_code Application_Handler(void)
    {


    // TODO: Write your application handling here.
    if( BUTTON_GetState() == BUTTON_PUSHED ){
        BUTTON_WaitForRelease();
        BUTTON_SetMode( BUTTON_ONOFF_FORMAIN);
        return MENU_Quit();
    }

    // This routine will get called repeatedly by CircleOS, until we
    // return MENU_LEAVE

#if 1
    // If the button is pressed, the application is exited
    if(BUTTON_GetState() == BUTTON_PUSHED)
        {
        BUTTON_WaitForRelease();
        return MENU_Quit();
        }
#endif

    return MENU_CONTINUE;   // Returning MENU_LEAVE will quit to CircleOS
    }

/*******************************************************************************
* Function Name  : MsgVersion
* Description    : Display the current CircleOS version and the version needed
*                  exit to main menu after 4 secondes
*
* Input          : None
* Return         : MENU_REFRESH
*******************************************************************************/
static enum MENU_code MsgVersion(void)
   {
   int hh,mm,ss,ss2;
   
   DRAW_DisplayString(5,60,"CircleOS",17);
   DRAW_DisplayString(80,60,UTIL_GetVersion(),6);
   DRAW_DisplayString(5,34,NEEDEDVERSION,6);
   DRAW_DisplayString(50,34," required",12);
   
   RTC_GetTime( &hh, &mm, &ss);
   ss = ss + 4;                  // 4 secondes 
   ss = ss%60;
   
   do
        {
        RTC_GetTime( &hh, &mm, &ss2 );
        }
   while ( ss2 != ss );           // do while < 4 secondes
   
   DRAW_Clear();
   return MENU_REFRESH;
   }

But when im trying to build it, i simply get the error:

Code:

C:\tmp\Cubic_step0\Step1.c:44: error: 'SQUARE_WIDHT' undeclared (first use in this function)  
 C:\tmp\Cubic_step0\Step1.c:44: error: (Each undeclared identifier is reported only once  
 C:\tmp\Cubic_step0\Step1.c:44: error: for each function it appears in.)  
  
Build failed

I have followed every step and copied the code from the tutorial but still some error, how come?

Thanks for your help!
//Reckan

EDIT: Sorry IF i posted this in the wrong section, in that case, please move it!

Last edited by Reckan (2010-12-13 09:39:44)

Offline

 

# 2   2010-12-13 10:46:51 Can't build tutorial

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Can't build tutorial

Hi Reckan,

It is just a little mistake in the use of the macro.
It is "SQUARE_WIDTH" and not  "SQUARE_WID$1"


Yves

Offline

 

# 3   2010-12-13 11:15:12 Can't build tutorial

Reckan
New member
Registered: 2010-12-13
Posts: 6

Re: Can't build tutorial

Aaarrgghh mad

I said it could just be me being stupid! Love those little mistakes!

Anyway thanks a lot smile

//Reckan

Offline

 

Board footer