Skip to content

Commit

Permalink
Print git revision in GMR command output
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Oct 14, 2014
1 parent 37dff1e commit 0bea18d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ bin/
.DS_Store
xcuserdata
project.xcworkspace
upload.sh
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ SRC_DIR := src
OBJ_DIR := obj
BIN_DIR := bin

CPPFLAGS+=-Iinclude -Isrc/include
GIT_REV := $(shell git rev-parse --short HEAD)

CPPFLAGS+=-Iinclude -Isrc/include -DREVISION_STRING=\"$(GIT_REV)\"
CFLAGS += -std=c99
CXXFLAGS += -std=c++0x

Expand Down
4 changes: 4 additions & 0 deletions include/dce_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

#define VERSION_STRING "0.1"

#ifndef REVISION_STRING
#define REVISION_STRING "?"
#endif

#if defined(ESP_PLATFORM)
#include "ets_sys.h"
#include "os_type.h"
Expand Down
2 changes: 1 addition & 1 deletion target/esp8266/info_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dce_result_t SECTION_ATTR dce_handle_GMM(dce_t* dce, void* group_ctx, int kind,

dce_result_t SECTION_ATTR dce_handle_GMR(dce_t* dce, void* group_ctx, int kind, size_t argc, arg_t* argv)
{
dce_emit_information_response(dce, VERSION_STRING, -1);
dce_emit_information_response(dce, VERSION_STRING " r" REVISION_STRING, -1);
dce_emit_basic_result_code(dce, DCE_RC_OK);
return DCE_OK;
}
Expand Down

0 comments on commit 0bea18d

Please sign in to comment.