RetroBSD

2.11BSD operating system for microcontrollers
It is currently Thu Feb 20, 2020 12:31 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Oct 09, 2015 5:53 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Trying to compile with i2c.h with delay.h under SmallerC (latest unix.hex and filesystem).
Code:
# cat i2c.h
// I2C() - a simple bitbanging
// Pito 10/2015
// based on http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html
#include "pins.h"
#include "delay.h"
// Fubarino SD - SDA pin D10, SCL pin D11
..

#define DL 3

void I2CInit(){
        sda_od;
        scl_od;
        udelay(DL);
        sdacl_out_0;
        udelay(DL);
..

Code:
# make
cc  -o rtc8563rd  rtc8563rd.c
/include/sys/proc.h:82: error: out of macro space!
*** Exit 1

Stop.
#

Code:
# cc -o bmp BMP085rd.c -lm
/include/sys/proc.h:82: error: out of macro space!
#

Code:
# cc -o i2cscan i2cscan.c
/include/sys/proc.h:82: error: out of macro space!
#

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Oct 11, 2015 12:50 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Ok, this is causing the trouble (in delay.h):
Code:
#include <sys/sysctl.h>
#include <machine/cpu.h>

Too big in a single chunk..

I've split the delay.c into delay.h and delay.c (as well as i2c and pins) and
Code:
# cc -o delay.o -c delay.c
# cc -o i2c.o -c i2c.c
# cc -o pins.o -c pins.c
# cc -o i2cscan i2c.o pins.o delay.o i2cscan.c
# ./i2cscan
I2C dev found, addr(r/w): 00(01/00)  1E(3D/3C)  4C(99/98)  53(A7/A6)  57(AF/AE)  68(D1/D0)  69(D3/D2)  77(EF/EE)

# cc -o BMP085.o -c BMP085.c
# cc -o bmp pins.o delay.o i2c.o BMP085.o BMP085rd.c -lm
# ./bmp
T= 237 x0.1C
p(abs)= 98398 Pa
p0= 101182 Pa
p0= 101185.179688 Pa
#

It seems it works now..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission