Jump to content

programming in C


cimo
 Share

Recommended Posts

so i am all set up to build a little application, i am working on OSX and everything seems to be ok, SDCC, Gputils, X-Code.I modified main.c and even got a successful build but there is no syx or hex output.Active target set to "MyProject".

what am i missing?

simone

Link to comment
Share on other sites

Hi Simone,

first question:

have you set up the targets like described here:

http://www.midibox.org/dokuwiki/how_to_use_xcode2_as_ide_on_a_mac#about_targets_and_makefiles

1. Target "Makefile"

2. Target "MyProject"

second question:

do the perl scripts in the "/skeleton/tools" directory have the right permissions? Means, they have to be allowed "executable". You can either do this by calling [tt]chmod[/tt] in the terminal or (easier) with the FTP-client of your choice (every FTP client has some infopanel where file-rights can be set easily)

Best,

Michael

Link to comment
Share on other sites

hi

yes it was all ok  but i ve found the problem there was a missing line in the makefile script for the project, due to a copy n paste at 5am in the morning! now i get errors but just because i modified the code and something is wrong.

thanks!!

now i ll try to create this little app. (it was in the assembler forum before)

4 buttons with leds

1 pot (pedal

i want the 4 buttons to switch among 4 different parameters (or midi channels) of the pot and having the leds for visual feedback

simone

Link to comment
Share on other sites

yeppaaa

so far the buttons are working and the pot as well, very easy

but when i add this code

/////////////////////////////////////////////////////////////////////////////

//  This function is called by MIOS when a complete MIDI event has been received

/////////////////////////////////////////////////////////////////////////////

void MPROC_NotifyReceivedEvnt(
  unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam
{
  // a note event provides 128 different note values (0..127)
  // in this simple example, each note sets an individual pin
  // for DOUT pin numbers, see also this documentation:
  // http://www.ucapps.de/mios/mios_pin_list.txt

  if( evnt0 == 0x80 || evnt0 == 0x90 ) {

    // 90 xx 00 is the same like a note off event!
    // (-> http://www.borg.com/~jglatt/tech/midispec.htm)
    if( evnt0 == 0x80 || evnt2 == 0x00 ) {

      // Note Off
      MIOS_DOUT_PinSet(pin, 0);

    } else {

      // Note On
      MIOS_DOUT_PinSet(pin, 1);

    }
  }
}

i get these errors

Building target “Pedal†of project “Pedal†with configuration “Debug†— (13 errors)

    cd /Users/simonemarin/Desktop/Pedal

    setenv ACTION build

    setenv ALWAYS_SEARCH_USER_PATHS YES

    setenv APPLE_INTERNAL_DEVELOPER_DIR /AppleInternal/Developer

    setenv APPLE_INTERNAL_DIR /AppleInternal

    setenv APPLE_INTERNAL_DOCUMENTATION_DIR /AppleInternal/Documentation

    setenv APPLE_INTERNAL_LIBRARY_DIR /AppleInternal/Library

    setenv APPLE_INTERNAL_TOOLS /AppleInternal/Developer/Tools

    setenv ARCHS ppc

    setenv BUILD_COMPONENTS "headers build"

    setenv BUILD_DIR /Users/simonemarin/Desktop/Pedal/build

    setenv BUILD_ROOT /Users/simonemarin/Desktop/Pedal/build

    setenv BUILD_STYLE Debug

    setenv BUILD_VARIANTS normal

    setenv BUILT_PRODUCTS_DIR /Users/simonemarin/Desktop/Pedal/build/Debug

    setenv CACHE_ROOT /Library/Caches/com.apple.Xcode.501

    setenv CCHROOT /Library/Caches/com.apple.Xcode.501

    setenv CHMOD /bin/chmod

    setenv CHOWN /usr/sbin/chown

    setenv CLASS_FILE_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/JavaClasses

    setenv CLEAN_PRECOMPS YES

    setenv CLONE_HEADERS NO

    setenv CONFIGURATION Debug

    setenv CONFIGURATION_BUILD_DIR /Users/simonemarin/Desktop/Pedal/build/Debug

    setenv CONFIGURATION_TEMP_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug

    setenv COPY_PHASE_STRIP NO

    setenv COPY_RESOURCES_FROM_STATIC_FRAMEWORKS YES

    setenv CP /bin/cp

    setenv CURRENT_ARCH ppc

    setenv CURRENT_VARIANT normal

    setenv DEBUGGING_SYMBOLS YES

    setenv DEBUG_INFORMATION_FORMAT stabs

    setenv DEPLOYMENT_LOCATION NO

    setenv DERIVED_FILES_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/DerivedSources

    setenv DERIVED_FILE_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/DerivedSources

    setenv DERIVED_SOURCES_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/DerivedSources

    setenv DEVELOPMENT_LANGUAGE English

    setenv DSTROOT /tmp/Pedal.dst

    setenv DWARF_DSYM_FILE_NAME .dSYM

    setenv DWARF_DSYM_FOLDER_PATH /Users/simonemarin/Desktop/Pedal/build/Debug

    setenv ENABLE_HEADER_DEPENDENCIES YES

    setenv EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES "*.nib *.lproj *.framework *.gch (*) CVS .svn *.xcodeproj *.xcode *.pbproj *.pbxproj"

    setenv FIXED_FILES_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/FixedFiles

    setenv FRAMEWORK_VERSION A

    setenv GCC_DYNAMIC_NO_PIC NO

    setenv GCC_ENABLE_AUTO_PCH NO

    setenv GCC_GENERATE_DEBUGGING_SYMBOLS YES

    setenv GCC_OPTIMIZATION_LEVEL 0

    setenv GCC_PFE_FILE_C_DIALECTS "c objective-c c++ objective-c++"

    setenv GCC_TREAT_WARNINGS_AS_ERRORS NO

    setenv GCC_VERSION 4.0

    setenv GENERATE_PKGINFO_FILE NO

    setenv GENERATE_PROFILING_CODE NO

    setenv GROUP simonemarin

    setenv HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT YES

    setenv HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_ALL_PRODUCT_TYPES YES

    setenv HEADERMAP_INCLUDES_NONPUBLIC_NONPRIVATE_HEADERS YES

    setenv HEADERMAP_INCLUDES_PROJECT_HEADERS YES

    setenv INFOPLIST_EXPAND_BUILD_SETTINGS YES

    setenv INSTALL_DIR /tmp/Pedal.dst

    setenv INSTALL_GROUP simonemarin

    setenv INSTALL_MODE_FLAG a-w,a+rX

    setenv INSTALL_OWNER simonemarin

    setenv INSTALL_ROOT /tmp/Pedal.dst

    setenv JAVAC_DEFAULT_FLAGS "-J-Xms64m -J-XX:NewSize=4M -J-Dfile.encoding=UTF8"

    setenv JAVA_APP_STUB /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub

    setenv JAVA_ARCHIVE_CLASSES YES

    setenv JAVA_ARCHIVE_TYPE JAR

    setenv JAVA_COMPILER /usr/bin/javac

    setenv JAVA_FRAMEWORK_RESOURCES_DIRS Resources

    setenv JAVA_JAR_FLAGS cv

    setenv JAVA_SOURCE_SUBDIR .

    setenv JAVA_USE_DEPENDENCIES YES

    setenv JAVA_ZIP_FLAGS -urg

    setenv JIKES_DEFAULT_FLAGS "+E +OLDCSO"

    setenv LEX /usr/bin/lex

    setenv LINK_FILE_LIST_normal_ppc

    setenv LOCAL_ADMIN_APPS_DIR /Applications/Utilities

    setenv LOCAL_APPS_DIR /Applications

    setenv LOCAL_DEVELOPER_DIR /Library/Developer

    setenv LOCAL_LIBRARY_DIR /Library

    setenv MAC_OS_X_VERSION_ACTUAL 1041

    setenv MAC_OS_X_VERSION_MAJOR 1040

    setenv NATIVE_ARCH ppc

    setenv NATIVE_ARCH_32_BIT ppc

    setenv NATIVE_ARCH_64_BIT ppc64

    setenv NATIVE_ARCH_ACTUAL ppc

    setenv NO_COMMON YES

    setenv OBJECT_FILE_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/Objects

    setenv OBJECT_FILE_DIR_normal /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/Objects-normal

    setenv OBJROOT /Users/simonemarin/Desktop/Pedal/build

    setenv OPTIMIZATION_LEVEL 0

    setenv OS MACOS

    setenv OSAC /usr/bin/osacompile

    setenv PASCAL_STRINGS YES

    setenv PATH_PREFIXES_EXCLUDED_FROM_HEADER_DEPENDENCIES "/usr/include /usr/local/include /System/Library/Frameworks /System/Library/PrivateFrameworks /Developer/Headers"

    setenv PKGINFO_FILE_PATH /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/PkgInfo

    setenv PREBINDING YES

    setenv PRECOMP_DESTINATION_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/PrefixHeaders

    setenv PRODUCT_NAME Pedal

    setenv PRODUCT_SETTINGS_PATH

    setenv PROJECT Pedal

    setenv PROJECT_DERIVED_FILE_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/DerivedSources

    setenv PROJECT_DIR /Users/simonemarin/Desktop/Pedal

    setenv PROJECT_FILE_PATH /Users/simonemarin/Desktop/Pedal/Pedal.xcodeproj

    setenv PROJECT_NAME Pedal

    setenv PROJECT_TEMP_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build

    setenv RECURSIVE_SEARCH_PATHS_FOLLOW_SYMLINKS YES

    setenv REMOVE_CVS_FROM_RESOURCES YES

    setenv REMOVE_SVN_FROM_RESOURCES YES

    setenv REZ_COLLECTOR_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/ResourceManagerResources

    setenv REZ_OBJECTS_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/ResourceManagerResources/Objects

    setenv SCRIPT_INPUT_FILE_COUNT 0

    setenv SCRIPT_OUTPUT_FILE_COUNT 0

    setenv SDKROOT

    setenv SED /usr/bin/sed

    setenv SET_DIR_MODE_OWNER_GROUP YES

    setenv SET_FILE_MODE_OWNER_GROUP NO

    setenv SHARED_DERIVED_FILE_DIR /Users/simonemarin/Desktop/Pedal/build/Debug/DerivedSources

    setenv SHARED_PRECOMPS_DIR /Library/Caches/com.apple.Xcode.501/SharedPrecompiledHeaders

    setenv SKIP_INSTALL YES

    setenv SOURCE_ROOT /Users/simonemarin/Desktop/Pedal

    setenv SRCROOT /Users/simonemarin/Desktop/Pedal

    setenv STRIP_INSTALLED_PRODUCT YES

    setenv SYMBOL_REPOSITORY_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/SymbolRepositories

    setenv SYMROOT /Users/simonemarin/Desktop/Pedal/build

    setenv SYSTEM_ADMIN_APPS_DIR /Applications/Utilities

    setenv SYSTEM_APPS_DIR /Applications

    setenv SYSTEM_CORE_SERVICES_DIR /System/Library/CoreServices

    setenv SYSTEM_DEMOS_DIR /Applications/Extras

    setenv SYSTEM_DEVELOPER_APPS_DIR /Developer/Applications

    setenv SYSTEM_DEVELOPER_DEMOS_DIR "/Developer/Applications/Utilities/Built Examples"

    setenv SYSTEM_DEVELOPER_DIR /Developer

    setenv SYSTEM_DEVELOPER_DOC_DIR "/Developer/ADC Reference Library"

    setenv SYSTEM_DEVELOPER_GRAPHICS_TOOLS_DIR "/Developer/Applications/Graphics Tools"

    setenv SYSTEM_DEVELOPER_JAVA_TOOLS_DIR "/Developer/Applications/Java Tools"

    setenv SYSTEM_DEVELOPER_PERFORMANCE_TOOLS_DIR "/Developer/Applications/Performance Tools"

    setenv SYSTEM_DEVELOPER_RELEASENOTES_DIR "/Developer/ADC Reference Library/releasenotes"

    setenv SYSTEM_DEVELOPER_TOOLS /Developer/Tools

    setenv SYSTEM_DEVELOPER_TOOLS_DOC_DIR "/Developer/ADC Reference Library/documentation/DeveloperTools"

    setenv SYSTEM_DEVELOPER_TOOLS_RELEASENOTES_DIR "/Developer/ADC Reference Library/releasenotes/DeveloperTools"

    setenv SYSTEM_DEVELOPER_UTILITIES_DIR /Developer/Applications/Utilities

    setenv SYSTEM_DOCUMENTATION_DIR /Library/Documentation

    setenv SYSTEM_LIBRARY_DIR /System/Library

    setenv TARGETNAME Pedal

    setenv TARGET_BUILD_DIR /Users/simonemarin/Desktop/Pedal/build/Debug

    setenv TARGET_NAME Pedal

    setenv TARGET_TEMP_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build

    setenv TEMP_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build

    setenv TEMP_FILES_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build

    setenv TEMP_FILE_DIR /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build

    setenv TEMP_ROOT /Users/simonemarin/Desktop/Pedal/build

    setenv UID 501

    setenv UNSTRIPPED_PRODUCT NO

    setenv USER simonemarin

    setenv USER_APPS_DIR /Users/simonemarin/Applications

    setenv USER_LIBRARY_DIR /Users/simonemarin/Library

    setenv USE_DYNAMIC_NO_PIC YES

    setenv VALID_ARCHS "m68k i386 sparc hppa ppc ppc7400 ppc970 ppc64 x86_64"

    setenv VERBOSE_PBXCP NO

    setenv VERSION_INFO_BUILDER simonemarin

    setenv VERSION_INFO_STRING "\"@(#)PROGRAM:Pedal  PROJECT:Pedal-  DEVELOPER:simonemarin  BUILT:\" __DATE__  \" \" __TIME__ \"\""

    setenv XCODE_APP_SUPPORT_DIR "/Library/Application Support/Apple/Developer Tools"

    setenv XCODE_VERSION_ACTUAL 0241

    setenv XCODE_VERSION_MAJOR 0200

    setenv YACC /usr/bin/yacc

    /bin/sh -c /Users/simonemarin/Desktop/Pedal/build/Pedal.build/Debug/Pedal.build/Script-DBB5DA7B0D3E3865006B57C5.sh

sdcc -S -mpic16 -p18F452 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2 -pleave-reset-vector -I. -DDEBUG_MODE=0 main.c -o _output/main.asm

Processor: 18F452

main.c:91: error 20: Undefined identifier 'pin'

main.c:91: error 20: Undefined identifier 'pin'

main.c:96: error 20: Undefined identifier 'pin'

main.c:96: error 20: Undefined identifier 'pin'

-:0: error 103: code not generated for 'MPROC_NotifyReceivedEvnt' due to previous errors

main.c:108: error 103: code not generated for 'MPROC_NotifyFoundEvent' due to previous errors

main.c:116: error 103: code not generated for 'MPROC_NotifyTimeout' due to previous errors

main.c:123: error 103: code not generated for 'MPROC_NotifyReceivedByte' due to previous errors

main.c:130: error 103: code not generated for 'SR_Service_Prepare' due to previous errors

main.c:137: error 103: code not generated for 'SR_Service_Finish' due to previous errors

main.c:147: error 103: code not generated for 'DIN_NotifyToggle' due to previous errors

main.c:158: error 103: code not generated for 'ENC_NotifyChange' due to previous errors

main.c:168: error 103: code not generated for 'AIN_NotifyChange' due to previous errors

make: *** [_output/main.asm] Error 1

main.c:91: error 20: Undefined identifier 'pin'

main.c:91: error 20: Undefined identifier 'pin'

main.c:96: error 20: Undefined identifier 'pin'

main.c:96: error 20: Undefined identifier 'pin'

-:0: error 103: code not generated for 'MPROC_NotifyReceivedEvnt' due to previous errors

main.c:108: error 103: code not generated for 'MPROC_NotifyFoundEvent' due to previous errors

main.c:116: error 103: code not generated for 'MPROC_NotifyTimeout' due to previous errors

main.c:123: error 103: code not generated for 'MPROC_NotifyReceivedByte' due to previous errors

main.c:130: error 103: code not generated for 'SR_Service_Prepare' due to previous errors

main.c:137: error 103: code not generated for 'SR_Service_Finish' due to previous errors

main.c:147: error 103: code not generated for 'DIN_NotifyToggle' due to previous errors

main.c:158: error 103: code not generated for 'ENC_NotifyChange' due to previous errors

main.c:168: error 103: code not generated for 'AIN_NotifyChange' due to previous errors

Build succeeded (13 errors)

Link to comment
Share on other sites

hi

AC i ve spent the last 2 hours with Jimp in the.. i ve spent the last 2 hours with BugFight in the chat, he was so kind to guide me on a step to step techno-progressive learning curve that led me to have:

-in the first phase all 4 buttons to send MIDI notes and leds to listen to the feedback

-then we moved to assign a variable to the pot CC and change the variable with the buttons, light was added in the 7th    day

now the TODO is

using a single button to change among, let s say 4 or 6 different CC for the pot, with 4 or 6 leds to visualize the status,

keeping the other 3 buttons as normal NOTE ON/OFF

i also need to scale and offset the pot, i am trying to figure out an hardware solution, hardware as modify the pot itself not as a circuitry, but if i fail i ll have to do it in the software.

thanks for your help guys

simone

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...