diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3cccbf3 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/src/app_mt/wifi/core/cc3000_common.h b/src/app_mt/wifi/core/cc3000_common.h index d5699f7..373f24a 100644 --- a/src/app_mt/wifi/core/cc3000_common.h +++ b/src/app_mt/wifi/core/cc3000_common.h @@ -45,6 +45,7 @@ #include #include #include +#include //***************************************************************************** // @@ -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 diff --git a/src/app_mt/wifi/socket.c b/src/app_mt/wifi/socket.c index 5ad89da..afd974f 100644 --- a/src/app_mt/wifi/socket.c +++ b/src/app_mt/wifi/socket.c @@ -519,7 +519,7 @@ 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. @@ -527,7 +527,7 @@ connect(long sd, const sockaddr *addr, long addrlen) //! @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. @@ -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; @@ -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) { diff --git a/src/app_mt/wifi/socket.h b/src/app_mt/wifi/socket.h index 99b77bb..7c0d920 100644 --- a/src/app_mt/wifi/socket.h +++ b/src/app_mt/wifi/socket.h @@ -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. @@ -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); //***************************************************************************** //