Jump to content

FrankGe

EstablishedMember
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About FrankGe

  • Rank
    Regular
  1. Hello BOOSTC 1.9.3 PIC16F877A OS XP SP2 A little project with 3 files main.c -------- #pragma CLOCK_FREQ 20000000 #include <system.h> #include "test.h" #pragma DATA 0x2007, _PWRTE_ON & _WDT_OFF & _HS_OSC & _BODEN_ON & _LVP_OFF rom char *msg = "Message"; void main( void ) { while(1) { write ('a'); write ("Test"); write (msg); } } test.h ------- #ifndef _test_H_ #define _test_H_ void write (const char c); void write (const char *s); void write (rom char *s); #endif test.c ------- #include "test.h" void write (const char c) { char a = c; } void write (const char *s) { while (*s) write (*s++); } void write (rom char *s) { char i = 0; char c; while (c = s) { write ©; i++; } } Compiling... "d:\Program Files\SourceBoost\boostc.pic16.exe" -t PIC16F877A main.c test.c BoostC Optimizing C Compiler Version 1.9.3 Beta (for PIC16 architecture) http://www.picant.com/c2c/c.html Copyright© 2004-2005 Pavel Baranov Copyright© 2004-2005 David Hobday test.c(18:13): error: failed to generate expression failure Done
  2. Hello, Very usefull is a split window in the sourceboost IDE. Like we have in MSVC++ Frank
  3. PIC 16F877A BOOSTC 1.9.2 OS Win XP SP2 A little project with 4 files Main.c -------- #include <system.h> #include "defs.h" #include "date.h" void main() { struct DateTime dt; getDateTime(&dt); } Date.h -------- #ifndef _date_h_ #define _date_h_ void getDateTime(struct DateTime *dt); #endif Date.c -------- #include "defs.h" void getDateTime(struct DateTime *dt) { dt->t.hour = 0; } Defs.h ------- #ifndef _DEFS_H_ #define _DEFS_H_ enum EWeekDay { MO = 1, TU, WE, TH, FR, SA, SU }; struct SDate { char year; char month; char day; char weekDay; }; struct STime { char hour; char min; char sec; char timezone; }; struct DateTime { struct SDate d; struct STime t; }; #endif Message: Compiling... "C:\Program Files\SourceBoost\boostc.pic16.exe" -t PIC16F877A main.c date.c BoostC Optimizing C Compiler Version 1.9.2 Beta (for PIC16 architecture) http://www.picant.com/c2c/c.html Copyright© 2004-2005 Pavel Baranov Copyright© 2004-2005 David Hobday defs.h(4): error: failure failure Failed to locate output file 'date.obj' Done Failed
  4. Hello Pavel The last example doesn't work. The function send(msg) does nothing. Look with the debugger. Frank
  5. BOOST 1.9.2 A little project with 3 files Main.c -------- #include <system.h> #include "main.h" bit b, b2; char c, c2; void main() { b = b2 = 0; c = c2 = 0; } main.h -------- #ifndef _Test_h_ #define _Test_h_ extern bit b, b2; extern char c, c2; #endif test.c ------- #include <system.h> #include "main.h" void test(void) { b = b2; char d = c; } When I link this then i got this error BoostC Optimizing C Compiler Version 1.9.2 Beta (for PIC16 architecture) http://www.picant.com/c2c/c.html Copyright© 2004-2005 Pavel Baranov Copyright© 2004-2005 David Hobday success BoostLink Optimizing Linker Version 1.9 Beta http://www.picant.com/c2c/c.html Copyright© 2004-2005 Pavel Baranov Copyright© 2004-2005 David Hobday Warning: argument of 'delay_us' calls must have a value of 1 or more Error: Failed to resolve external:b2 Error: Failed to resolve external:b2 Failed Exit code was -1. [No error.] Removing target: main.hex Failed to locate output file 'main.hex' Done Failed
  6. Hello, Sourceboost 5.8 BoostC 1.9.2 OS: XP sp2 A little project with 2 files main.c -------- #pragma CLOCK_FREQ 20000000 #include <system.h> #include "main.h" void main() { struct DateTime dt; while (1) { setDateTime(&dt); } } void setDateTime(struct DateTime *date) { } main.h -------- #ifndef _structTest_h_ #define _structTest_h_ // PCF8583 Clock registers #define control 0x00 #define hundredths 0x01 #define seconds 0x02 #define minutes 0x03 #define hours 0x04 #define date 0x05 #define months 0x06 #define timer 0x07 #define alarm_ctrl 0x08 #define alarm_hundreds 0x09 #define alarm_seconds 0x0a #define alarm_minutes 0x0b #define alarm_hours 0x0c #define alarm_date 0x0d #define alarm_month 0x0e #define alarm_timer 0x0f #define ramzero 0x10 enum WeekDay { MO = 1, TU = 2, WE = 3, TH = 4, FR = 5, SA = 6, SU = 7 }; struct Date { char year; char month; char day; char weekDay; }; struct Time { char hour; char min; char sec; char timezone; }; struct DateTime { struct Date d; struct Time t; }; void setDateTime(struct DateTime *date); #endif When I try to compile this then I've got this message Compiling... "D:\Program Files\SourceBoost\boostc.pic16.exe" -t PIC16F877A StructTest.c BoostC Optimizing C Compiler Version 1.9.2 Beta (for PIC16 architecture) http://www.picant.com/c2c/c.html Copyright© 2004-2005 Pavel Baranov Copyright© 2004-2005 David Hobday structTest.h(56): error: missing right paren failure Failed to locate output file 'StructTest.obj' Done Failed But I think mu code is ok. A strange thing is when I put all the "#define" in comment then there is no error Frank
  7. Hello, OS: XP SP2 Sourceboost 5.8 BOOSTC 1.9.2 There is still a problem with "rom char *" #include <system.h> rom char *msg = "Message"; void send(const char c) { char b = c; } void send(const char* s) { char c; char i = 0; while(c = s) { send©; i++; } } void main() { while (1) { send ('a'); send ("Test"); send (msg); } } When I have to cast to "rom char *" I think the compiler should give me an error. because it doesn't work. Frank
  8. Hello, Problem not fixed in BOOSTC 1.9.2 Frank
  9. Hello, Sourceboost: 5.8 Boostc: 1.91 OS: XP sp2 A little project #include <system.h> struct Test { char c; bit b; }; void get(struct Test *t) { t->c = 1; t->b = 0; } void main() { struct Test t; t.b = 1; t.c = 5; get(&t); } The compiler gives an error Compiling... "C:\Program Files\SourceBoost\boostc.pic16.exe" -t PIC16F877A test2.c BoostC Optimizing C Compiler Version 1.9.1 Beta (test build) (for PIC16 architecture) http://www.picant.com/c2c/c.html Copyright© 2004-2005 Pavel Baranov Copyright© 2004-2005 David Hobday test2.c(12:7): internal error: failed to generate assignment expression failure Done Frank
  10. Pavel, Dave, I've got now a new project without "rom char * " but it doesn't work #include <system.h> void send(char c) { char b = c; } void send(char* s) { char c; char i = 0; while(c = s) { send©; i++; } } void main() { while (1) { send ('a'); send ("Test"); } } Frank.
  11. Pavel, I changed my code to void send(rom char* s) { while (*s) send(*s++); } now i've got a compilation error error invalid operation applied to operand with 'rom' storage type. when I change my code to void send(rom char* s) { char i = 0; while(s) { send(s); i++; } } it works fine, but why can't I use pointers ? Frank
  12. Environment: Sourceboost 5.8 BoostC 1.9 OS: XP sp2 PIC: 16F877a Compile and debug this code only the first send in main() works. #include <system.h> rom char *msg = "Message"; void send(const char c) { char b = c; } void send(const char* s) { while (*s) send(*s++); } void main() { send ('a'); send ("Test"); send (msg); }
  13. Hello, Language BOOSTC 1.8 PIC: 16F877A OS: Win XP SP2 #pragma CLOCK_FREQ 20000000 #include <system.h> #define PORTA 0x05 volatile bit led0@PORTA.0; // RA0 volatile bit led1@PORTA.1; // RA1 volatile bit led2@PORTA.2; // RA2 volatile bit led3@PORTA.3; // RA3 void main( void ) { trisa = 11110000b; //PORTA = input/output while(1) { delay_ms(250); led0 = led1 = led2 = led3 = 1; delay_ms(250); led0 = led1 = led2 = led3 = 0; } } Watch with the debugger to the LED block of PORTA It doesn't work Frank
  14. Dave, When will be there the next release? Frank
×
×
  • Create New...