Skip to content

Commit

Permalink
Merge pull request #8 from skonzem/dockerize
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
hebnern authored Jan 2, 2019
2 parents 96e8ca3 + 8b42625 commit 14f569d
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 14 deletions.
62 changes: 62 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM ubuntu:18.04

# Dependencies for model-t
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:team-gcc-arm-embedded/ppa \
&& apt-get update && apt-get install -y \
freetype* \
gcc-arm-embedded \
libprotobuf-dev \
netcat \
protobuf-compiler \
python-pip \
python-protobuf \
python-pystache \
screen

# Dependencies for pygame (http://www.pygame.org/wiki/CompileUbuntu)
RUN apt-get install -y \
fluid-soundfont-gm \
fontconfig \
fonts-freefont-ttf \
git \
libavcodec-dev \
libavformat-dev \
libfreetype6-dev \
libportmidi-dev \
libsdl1.2-dev \
libsdl-image1.2-dev \
libsdl-mixer1.2-dev \
libsdl-ttf2.0-dev \
libsmpeg-dev \
libswscale-dev \
libtiff5-dev \
libx11-6 \
libx11-dev \
python-dev \
python-numpy \
python-opengl \
xfonts-100dpi \
xfonts-75dpi \
xfonts-base \
xfonts-cyrillic \
&& rm -rf /var/lib/apt/lists/*

RUN pip install Pygame==1.9.4

RUN useradd -d /brewbit -m -U -s /bin/bash brewbit \
&& mkdir /brewbit/model-t && chown brewbit:brewbit /brewbit/model-t

VOLUME /brewbit/model-t
WORKDIR /brewbit/model-t
COPY --chown=brewbit:brewbit . .
USER brewbit

RUN cd .. \
&& git clone https://github.com/brewbit/brewbit-protobuf-messages \
&& git clone https://github.com/ChibiOS/ChibiOS --branch stable_2.6.x \
&& git clone https://github.com/nanopb/nanopb \
&& cd nanopb && git checkout -b nanopb-0.2.4 nanopb-0.2.4

CMD make
9 changes: 1 addition & 8 deletions src/app_mt/wifi/core/cc3000_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <errno.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/time.h>

//*****************************************************************************
//
Expand Down Expand Up @@ -141,17 +142,9 @@ extern "C" {
//*****************************************************************************
// Compound Types
//*****************************************************************************
typedef long time_t;
typedef uint32_t clock_t;
typedef long suseconds_t;

typedef struct timeval timeval;

struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};

//*************************************************************************************
//@@@ Socket Common Header - Start

Expand Down
8 changes: 4 additions & 4 deletions src/app_mt/wifi/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ connect(long sd, const sockaddr *addr, long addrlen)

//*****************************************************************************
//
//! select
//! wfd_select
//!
//! @param[in] nfds the highest-numbered file descriptor in any of the
//! three sets, plus 1.
//! @param[out] writesds socket descriptors list for write monitoring
//! @param[out] readsds socket descriptors list for read monitoring
//! @param[out] exceptsds socket descriptors list for exception monitoring
//! @param[in] timeout is an upper bound on the amount of time elapsed
//! before select() returns. Null means infinity
//! before wfd_select() returns. Null means infinity
//! timeout. The minimum timeout is 5 milliseconds,
//! less than 5 milliseconds will be set
//! automatically to 5 milliseconds.
Expand Down Expand Up @@ -555,7 +555,7 @@ connect(long sd, const sockaddr *addr, long addrlen)
//
//*****************************************************************************
int
select(long nfds, wfd_set *readsds, wfd_set *writesds, wfd_set *exceptsds, struct timeval *timeout)
wfd_select(long nfds, wfd_set *readsds, wfd_set *writesds, wfd_set *exceptsds, struct timeval *timeout)
{
int ret;

Expand Down Expand Up @@ -1001,7 +1001,7 @@ socket_io_thread(void *arg)
}
}

ret = select(maxFD, &readsds, NULL, NULL, &timeout); /* Polling instead of blocking here\
ret = wfd_select(maxFD, &readsds, NULL, NULL, &timeout); /* Polling instead of blocking here\
to process "accept" below */

if (ret>0) {
Expand Down
4 changes: 2 additions & 2 deletions src/app_mt/wifi/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ extern long connect(long sd, const sockaddr *addr, long addrlen);

//*****************************************************************************
//
//! select
//! wfd_select
//!
//! @param[in] nfds the highest-numbered file descriptor in any of the
//! three sets, plus 1.
Expand Down Expand Up @@ -322,7 +322,7 @@ extern long connect(long sd, const sockaddr *addr, long addrlen);
//! @sa socket
//
//*****************************************************************************
extern int select(long nfds, wfd_set *readsds, wfd_set *writesds, wfd_set *exceptsds, struct timeval *timeout);
extern int wfd_select(long nfds, wfd_set *readsds, wfd_set *writesds, wfd_set *exceptsds, struct timeval *timeout);

//*****************************************************************************
//
Expand Down

0 comments on commit 14f569d

Please sign in to comment.