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.
  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 SDat
  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-20
  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
  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© 2
  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 Fran
  14. Dave, When will be there the next release? Frank
×
×
  • Create New...